I have two ways editing crontab
1. edit /etc/crontab, then restart crond
2. crontab -e crontab
in both cases I am logged in as root.
what are the differences?
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
|
|||
|
|
migrated from stackoverflow.com May 18 '11 at 4:03
|
Generally... you should avoid directly editing /etc/crontab unless you want to modify the core configuration. Unless this is something that needs root privileges, you should probably execute your cron from a less privileged account. |
|||
|
|
|
Option 2 is the documented method, it will work for users other than root (e.g. a user who does not have the rights to restart crond and whose crontab file is not the one you have named). Each user can have a crontab file if allowed by local config (/etc/cron.allow, /etc/cron.deny) and these are held in /var/spool/cron/crontabs/$USER. These files should not be directly edited but the interface used |
|||
|
|