Using Cron

The cron Windows command controls the Windows-based Cron service, which runs commands at specified dates and times, much like the Interix-based cron(1) daemon.

Users can schedule commands using the crontab Windows command. These entries are stored in the username file in the %windir%\system32\drivers\etc\cron\crontabs directory. The results of running the cron command are written to Event Viewer with the application name Cron Service.

When the Cron service is installed, the file %windir%\system32\drivers\etc\cron\cron.allow is created with entries for all the members of the Administrators group.

Users are permitted to use crontab if their user names appear in the cron.allow file. If that file does not exist, the file %windir%\system32\drivers\etc\cron\cron.deny is checked to determine if the user should be denied access to crontab. If neither file exists, only users belonging to the Administrator group are allowed to submit a job. If both files exist, only cron.allow is checked. If cron.allow does not exist and cron.deny exists but is empty, global usage is permitted. The allow/deny files consist of one user name per line.

The Cron service keeps track of the user associated with a particular job and carries out the job under that user's identity. A user can provide the password while setting up the crontab entry, or, if the administrator allows, by using a sub-authorization mechanism. If neither of these works, however, the job can be carried out under a default user with limited privileges.

Note