Cron scheduling options
The sixth field of a crontab entry is a string that your shell executes at the specified time. If any real not logical line in the file is blank or begins with , the shell ignores the line treats it as a comment. For each entry in the crontab file, crontab creates a task to be run by the Windows Task Scheduler using taskrun. The command portion of each entry will be executed using. Because crontab must create Windows Task Scheduler tasks for the entries listed in the crontab , there may be a significant pause while crontab creates these tasks.
The task will be run using the current user name, the retrieved password, and the normal start-up environment for the user. If a password cannot be retrieved, the task is added with no user name and password. You must be in the administrator group to add tasks without having a password saved with the mksauth authentication service. Such tasks are run using the environment as it exists at the time of their execution.
Common practice is to redirect the standard output and standard error from tasks to files so you can read the output after the tasks have completed. You must have smtpmail properly set up on your system. When both environment variables are set, the streams are both e-mailed and written to the log file. When a task does not produce any output or errors, you are not normally informed of its completion.
Once a task name has been assigned to a task, you should not rename that task. If you have an EDITOR environment variable defined, crontab assumes that the variable's value is the name of the editor you want to use. When a crontab file is removed using this option, it cannot be rebuilt using the -u. This ensures that the Window Task Scheduler has a correct list of scheduled tasks and that those tasks are run using the correct environment.
This option is also useful if crontab 's update of the Windows Task Scheduler is interrupted and the tasks are not added. Because the crontab file still exists, you can use this option to ensure that all crontab entries are added. This option does not work if the crontab file was removed with the -r option. The default editor is vi. In addition, information about a scheduled job such as the working directory is displayed using Windows path names.
The first five are integer patterns and the sixth is the command to execute. The following table briefly describes each of the fields:.
An element is either a number or an inclusive range, indicated by two numbers separated by a minus sign e. You can specify days with two fields: If you specify both of them as a list of elements, cron will observe both of them, for example:. The cron daemon would run the program myprogram in the mydir directory on the first and fifteenth of each month, as well as on every Monday.
If a cron job specified in your crontab entry produces any error messages when it runs, you will get a mail message reporting the errors. This is document afiz in the Knowledge Base. Last modified on Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.
Options Help Chat with a consultant. What are cron and crontab, and how do I use them? This content has been archived , and is no longer maintained by Indiana University. Resources linked from this page may no longer be available or reliable. On many systems, this command is executed simply as crontab filename i. Display the last time you edited your crontab file. This option is available on only a few systems. Used in conjunction with other options, this option allows you to modify or view the crontab file of user.
When available, only administrators can use this option. Field Value Description minute The exact minute that the command sequence executes. The complete sequence of commands to execute. The command string must conform to Bourne shell syntax.