Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delegate within a crontab to use another file as a crontab? aka Crontab in SVN/CVS?

Maybe theres another solution to this. I built a web app that requires 5-10 crons to keep it maintained and various intervals. I want to check-in the crontab into version control, so that it can be easily deployed to other servers.

I would like to be able to put a line in the /etc/crontab file that would tell it to look into /myapp/app.crontab file and treat all the lines in that file as crontab entries... ie:

0 1 * * *    root   /bin/sh /do/something.sh

Why not just checkin /etc/crontab? Because when deploying from server to server, some servers may have different entries in their crontabs that i dont want to interfere with.

Any ideas? What are other people doing for storing a bunch of crontab entries in rev ctrl?
Thanks.

like image 717
timh Avatar asked Dec 31 '25 22:12

timh


1 Answers

Put your crontab file in /etc/cron.d/ - either as a checked out file or a symlink to the checked out file.

like image 96
Anders Westrup Avatar answered Jan 02 '26 13:01

Anders Westrup



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!