There's another good discussion forming around where to put your crontabs on the SAGE mailing list.
On linux based systems, there are typically 4 places to stick your crontabs:
- Where ever crontab -e puts them on your system (per user crons)
- /etc/crontab
- /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly and /etc/cron.monthly
- /etc/cron.d
Putting them into /etc/cron.d makes it easy to revision control the files and keep track of changes. It's also handy for package management -- you can build a custom RPM or DEB of your app and have it drop any required crontabs into /etc/cron.d.
Crons should never run as human user account. When they are configured this way, they tend to break if someone leaves or an account is shut down for other reasons. Depending on what the cron needs access to, it should run as nobody, apache, and in special cases, root. It's easy to configure which user a cron runs as in these files since each entry in the file requires you to specify which user to run as.
Of course, if your cron doesn't support /etc/cron.d, ignore everything I said :)
No comments:
Post a Comment