Copying a crontab file directly into /var/spool/cron/crontabs/<username>
does not schedule the job for execution.
crontab -l
shows the file contents, so cron is at least somewhat aware of it. But it never gets executed.
If I edit with crontab -e
and make a meaningless change, then cron somehow gets notified and all is well.
Is there a programmatic way to achieve the same effect?
Referring to this question, I have tried these commands with no luck:
sudo service cron reload
sudo service cron restart
sudo /etc/init.d/cron force-reload
P.S. Yes, I know copying a crontab file directly into /var/spool is not the usual way to do things. This is part of a larger task of setting up new cookie-cutter aws ec2 ubuntu instances via docker, and I want them to come “pre-loaded” with specific crontabs.