How to set cronjob/crontab in server using command prompt. Give sample command or sample links.

migrated from stackoverflow.com Aug 19 '09 at 0:56

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

crontab -e

edit crontab interactively with your default editor

crontab <file>

replace crontab with contents of given file

General usage help is displayed if you run crontab without arguments, for example:

crontab: usage error: file name must be specified for replace
usage:  crontab [-u user] file
    crontab [-u user] { -e | -l | -r }
        (default operation is replace, per 1003.2)
    -e  (edit user's crontab)
    -l  (list user's crontab)
    -r  (delete user's crontab)
    -i  (prompt before deleting user's crontab)

More help available via "man crontab".

crontab -e

will work wonders when you’re trying to edit your crontab.


The pimlottc's answer looks perfect(+1). But I will left you a link to a little tutorial because you asked for it. cron&crontab-howto


Hi check this link here step by step explan how you can set cron using comman prompt. Its a very gud tutorial for me ... http://phpsollutions.blogspot.in/2014/02/set-up-cron-job-using-command-prompt.html

  • Welcome to serverfault. We prefer to have an excerpt with the relevant information from any links posted. Please edit your post to include the most relevant data from the link. – MichelZ Apr 4 '14 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy