System Crontab or Root Crontab.
/etc/crontab
is the system-wide crontab.
The format of/etc/crontab
is like this:
# m h dom mon dow user command
* * * * * someuser echo 'foo'
whilecrontab -e
is per user, it’s worth mentioning with no-u
the argument the crontab command goes to the current user’s crontab. You can docrontab -e -u <username>
to edit a specific user’s crontab.
Notice in a per-user crontab there is no ‘user’ field.
# m h dom mon dow command
* * * * * echo 'foo'
An aspect of crontabs that may be confusing is that root also has its own crontab. e.g.crontab -e -u root
will not edit/etc/crontab
In most Linux distros, per-user crontabs are typically stored in the: /var/spool/cron/crontabs/<username>
(Vixie-cron).
RHEL-based distributions are stored in/var/spool/cron/<username>
. (cronie)