• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL



crontab Maintains crontab files for individual users.
crontab [-u <user>] <file>

crontab [-u <user>] [-l | -r | -e]

crontab is the program that installs, removes, or lists the tables the cron (8) executes for users. Each user can have his own crontab, which is stored in /var/cron/tabs/. The crontab is not edited directly.
If /var/cron/allow exists, the <user> must be listed in the file to be able to use cron. If /var/cron/allow does not exist, but /var/cron/deny exists, <user> must not be listed in this file to use this command. If neither file exists (depending on site-dependent configuration), either only the super user may use this command or all users may be able to use this command.
The first form of the command installs a crontab from <file> or standard input, if - is given instead of <file>. The second form of the command displays, removes, or edits the installed crontab.
-u <user> Specifies the name of the user. If not specified, the user issuing the command is assumed. If crontab is being used inside an su command, -u should be used.
-l Lists the current crontab on standard output.
-r Removes the current crontab.
-e Edits the current crontab using the editor specified by the environment variables VISUAL or EDITOR. On exiting the editor, the modified crontab is automatically installed.
Basic format of a crontab statement, with value ranges shown here:
minute hour day_of_month month day_of_week [<user>] <command>
0-59 0-23 1-31 1-12 0-7 (Sunday may be 0 or 7)

Fields may be separated by spaces or tabs. * may be used as the value of a field to mean all possible values for that field. A field value may be further specified by providing a single value, a comma-separated list of values, a range of values, or a comma-separated list of single values or ranges of values.
Step values may be specified by use of <range>/<number>. For example, 0-23/2 would be every other hour. 0-23/2 is equivalent to the value list 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22. Step values may also be specified by */<number>. For example, every other hour could also be specified by */2 in that field.
Names may also be used for the month and day_of_week fields. Names are the first three characters of the actual name. Case does not matter. Lists or ranges of names, however, may not be used.
The <user> field is specified only in a system crontab.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint