Menu

Ansible put our export job in /etc/cron.d and Debian's cron never read the file
📰

Ansible put our export job in /etc/cron.d and Debian's cron never read the file

DEV Community: ansible·Sergey Shinder·3 days ago
#G9OXdI11
#devtoansible#devto#dev#file#cron
Reading 0:00
15s threshold

Our nightly stock export to two marketplaces runs from cron on a pair of integration servers. For years they ran CentOS 7, and an Ansible role installed the job by templating a file into /etc/cron.d. The file was called stock-export.cron, because the template was stock-export.cron.j2 and the task simply dropped the .j2.

In the summer we rebuilt the pair on Debian 12 with the same role. The play was green, the file was there with the right owner, mode and contents, and a reviewer compared it line by line with the old server. For six nights the export did not run. We found out when one marketplace kept showing products as in stock that we had sold out of on the Saturday.

Debian's cron reads /etc/cron.d by the same naming rules as run-parts. A file name may contain letters, digits, underscores and hyphens and nothing else, so a name with a dot in it is skipped, and the manual page says so in as many words.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.