[CentOS] cron clarification

Tue Jan 1 23:28:21 UTC 2008
Stephen Harris <lists at spuddy.org>

On Tue, Jan 01, 2008 at 04:08:17PM -0700, Joseph L. Casale wrote:
> What is the ramifications to simply placing scripts in the /etc/cron.hourly directory as opposed to actually adding jobs via the crontab -e method?
> Is there any significance to using one method versus the other?

If you don't need to run something at a specific time then cron.hourly
is easier and simpler.  Just drop the script into the directory.

If you need something at a specific time then look into /etc/cron.d/
which is similar to traditional crontab format, but again is simply a matter
of dropping files into that directory.
eg
  % cat /etc/cron.d/sysstat
  # run system activity accounting tool every 10 minutes
  */10 * * * * root /usr/lib/sa/sa1 1 1
  # generate a daily summary of process accounting at 23:53
  53 23 * * * root /usr/lib/sa/sa2 -A

Traditional crontab entries do still work, if you really want to deal
with that, but it's harder to automate install/uninstalls.

-- 

rgds
Stephen