Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com May 18 '11 at 4:03

This question came from our site for professional and enthusiast programmers.

2 Answers 2

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.