What is the difference between the purposes of
/etc/crontab
- files under
/etc/cron.d/
/var/spool/cron/crontabs/root
If you want to add a cron job, into which file would you add it?
manpage of cron(8) Says
/etc/cron.d/: directory that contains system cronjobs stored for different users.
What does "stored for different users" mean?
It looks confusing with files under /var/spool/cron/crontabs/
.
https://unix.stackexchange.com/a/478581/674 quotes from cron manpage:
In general, the system administrator should not use /etc/cron.d/, but use the standard system crontab /etc/crontab.
Shall a sysadmin add a job to /etc/crontab
, /etc/cron.d/
or /var/spool/cron/crontabs/root
?
Thanks.
/etc/crontab
is deprecated, and/etc/cron.d
is how you set up cron jobs for different users (i.e., jobs which specify the user alongside the time). Debian derivatives are different. The manpage means what it says, but it doesn’t make sense if you try to apply it to Debian derivatives. – Stephen Kitt Nov 01 '18 at 15:10/var/spool/cron/crontabs/
also deprecated on Fedora, RHEL and derivatives? – Tim Nov 01 '18 at 15:28