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.

What is the difference between the crontab located in /etc/crontab and the crontab that can be edited using crontab -e?

share|improve this question

2 Answers 2

up vote 14 down vote accepted

As Ignacio said, /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'

while crontab -e is per user, it's worth mentioning with no -u argument the crontab command goes to the current users crontab. You can do crontab -e -u <username> to edit a specific users 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 See Configuring cron.

In Linux distros, per user crontabs are typically stored in: /var/spool/crontabs/<username>

share|improve this answer

One is the system crontab and can only be edited by root, and the other is the user crontab and can be edited by a user and exists per user.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.