What's the difference between creating a script in
/etc/cron.hourly/myScript
Or adding the script in crontab -e
with:
# m h dom mon dow command
0 * * * * myScript
When I run crontab -l
or sudo crontab -l
I don't see the scripts created in /etc/cron.*
Is there any advantage of using one or the other?
Best Answer
User
crontab
files (the kind produced by non-root
crontab -e
) are stored in/var/spool/cron/crontabs/<user>
.root
cron
jobs are run through/etc/cron.hourly
,/etc/cron.daily
,/etc/cron.weekly
and/etc/cron.monthly
, and controlled via/etc/crontab
. The comments at the top of/etc/crontab
say: