[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SAGE] crontabs vs /etc/cron.[daily,hourly,*] vs. /etc/cron.d/



So, with most Linux installs, you have these options:

1. normal use of crontabs
2. creating a crontab-like entry in a file in /etc/cron.d/
3. creating symlinks to your scripts in /etc/cron.hourly/,
/etc/cron.daily/, etc. (I'll just say /etc/cron.daily to be short.)
4. /etc/crontab for the root user being able to run cron jobs as any
user, unlike /etc/cron.d/ and /etc/cron.daily/.

The question here isn't one of technical correctness (they are all
correct), but one of consistency both internally and, potentially, with
other people messing with cronjobs on the same box.

The debate started when I logged into a server and didn't see our jobs
in root's crontab or as symlink under /etc/cron.daily/. They were in
/etc/cron.d/. Fine. Except I never do that. I usually use a user's
crontab or /etc/cron.daily/. So, immediately, we have a internal
consistency issue, which could, conceivably, cause me to create a
duplicate cronjob. (Let's ignore documentation and change management.)


I did the same thing recently, creating a duplicate job in the root
crontab after a few years away from active Linux use, and forgetting
about /etc/crontab and the /etc/cron.*/ directories. There are too many
places to put the same thing.

Personally, I prefer a per-user crontab. For one, it's the only thing a
plain user can modify directly if he or she wants to manage jobs. In
addition, I believe it's the only mechanism that works consistently on
all modern UNIXen. However, the /etc/cron.*/ stuff is useful for
packaged software.

--------------------------------------------------------------------
Leon Towns-von Stauber                  http://www.occam.com/leonvs/
"We have not come to save you, but you will not die in vain!"