I'm root, and I saw there are a lot of contents in /etc/crontab
, which I thought is the root's cron job configurations. When I use crontab -e
, I saw nothing in the editor; after I quit crontab -e
, what I added was not found in /etc/crontab
. So, where is root's cron job configuration stored? And other users?
It is stored in the directory:
/var/spool/cron/crontabs
Containing one file per user.
From man crontab
(at least on my Ubuntu 13):
There is one file for each user's crontab under the /var/spool/cron/crontabs directory. Users are not allowed to edit the files under that directory directly to ensure that only users allowed by the system to run periodic tasks can add them, and only syntactically correct crontabs will be written there. This is enforced by having the directory writable only by the crontab group and configuring crontab command with the setgid bid set for that specific group.
It is distribution-dependant, but mostly it is in /var/spool/crontab/<username>
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With