Oct 28, 2011
tom

What’s the difference between /etc/cron.d and /var/spool/cron?

Question

The crontabs on RHEL seem to be duplicated in two places, /etc/cron.d, and /var/spool/cron. I’ve checked, and neither of these are simlinks to the other, and neither are any of the crons contained in either location.

I guess my most important question is this, which of these two is the authoritative location? If I were to edit a file in only one of these two, which one would I have to make my edit in to get it to execute?

Answer

/var/spool/cron is where the individual user crontabs live. As user, crontab -e edits the corresponding file in /var/spool/cron.

/etc/cron.d is a directory that is scanned for modular crontab files. The syntax is slightly different for files in that directory. The cron entries have an additional field for a user to run the cron entries as. This is the same as a systemwide /etc/crontab file.

See RedHat’s documentation here: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/3/html/System_Administration_Guide/ch-autotasks.html

Related posts:

  1. Cron: Permission denied on everything
  2. Script Help – Parse /var/spool/mail/user
  3. CRON problems… “Could not open input file:”
  4. What user do scripts in the cron folders run as? (i.e. cron.daily, cron.hourly, etc)
  5. formatting of cron.allow and/or does cron need to be restarted

Leave a comment