Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

under debian as a root (using su -)

First of all there is already a job inside the server (done by someone else), when I type

crontab -e

I get

# m h  dom mon dow   command
* * * * * sh /opt/

It executes exery minute.

Anyway, I am trying to add a scheduled job to the crontab: I want tried to add a second job that will be executed every day at 00:30 am.

30 0   * * *    sh /opt/

I have two problems:

  • I am not able to edit the crontab with crontab -e
  • Is my newscript scheduling right ?
share|improve this question

your scheduling is right. i'm not sure why you can't edit the crontab. do you get any error message?

share|improve this answer

If you're getting something like:

crontab: you are not authorized to use cron.  Sorry.

Add your username to /etc/cron.allow (or /etc/cron.d/cron.allow, depending on your setup).

You didn't mention what system you're running on, but several commercial Unixen default to using ed as the editor, instead of something sensible like vi. Set EDITOR=vi and try again:

$ EDITOR=vi crontab -e

Which will use vi as your editor. Replace vi with emacs or even [shudder] pico, whatever you're most comfortable with.

Another option is to use the file form of crontab:

$ crontab /tmp/ctab

Which will assign the contents of the file /tmp/ctab to the crontab for the current user. You can then edit /tmp/ctab (the name is not important) with whatever editor you like that can save as plain text: vi, emacs, Xcode, eclipse, whatever. First, do:

$ crontab -l > /tmp/ctab

To get a copy of the current crontab, so you can add to it (the crontab FILE form replaces the current crontab), then do:

$ crontab /tmp/ctab

To import the contents of /tmp/ctab.

share|improve this answer

Your Answer


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