Next: , Previous: , Up: Invoking   [Contents][Index]


4.3 Invoking crontab

This program is run by individual users to inspect or modify their crontab files. If a change is made to the file, then the root daemon process will be given a kick, and will immediately read the new configuration. A warning will be issued to standard output if it appears that a cron daemon is not running.

The command is used as

crontab [-u user] file

or

crontab [-u user] ( -l | -e | -r )

Only the root user can use the -u option, to specify the manipulation of another user’s crontab file. In the first instance, the entire crontab file of the user is replaced with the contents of the specified file, or standard input if the file is “-”.

In the latter case, the program behaves according to which of the (mutually exclusive) options was given (note that the long options are an mcron extension).

-l
--list

Print the user’s crontab file to the standard output, and exit.

-r
--remove

Delete the user’s crontab file, and exit.

-e
--edit

Using the editor specified in the user’s VISUAL or EDITOR environment variables, allow the user to edit their crontab. Once the user exits the editor, the crontab is checked for parseability, and if it is okay then it is installed as the user’s new crontab and the daemon is notified that a change has taken place, so that the new file will become immediately effective.


Next: , Previous: , Up: Invoking   [Contents][Index]