by makecheck · 10y ago · 0 comments
Also, I name the files according to host so I remember exactly where they were installed in a networked environment (e.g. "host1.crontab", "host2.crontab").
Make changes active with `crontab ~/.cron/crontab`
Diff with `diff -du <(crontab -l) <(cat ~/.cron/crontab)`
For servers or not-my-own-user crontabs, config management is the way to go. The crontabs should be in a config management repository, so there's not just a single copy that's deployed and active.
crontab x.crontab
your crontab file is replaced by the contents of x.contrab; or if you want to install x.crontab for another user crontab -u www-user x.crontab
The actual location of x.crontab does not matter as it is just used to setup your cron jobs, but the system does not actually read from this file to run the jobs.