Setup Cygwin Cron

* Install “Admin/cron”
* Install “Admin/cygrunsrv”
* Install “Editors/vim”
* Start Cron as a service

For *Non* Windows 2003 Servers

$ cron-config
Cron is already installed as a service under account NAUser-Name.
Do you want to remove or reinstall it? (yes/no) yes
OK. The cron service was removed.
 
Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ntsec smbntsec] ntsec
 
The service can run either as yourself or under a privileged account.
Running as yourself allows better access to network drives,
but does not allow to run the crontab of other users.
Do you want to the cron daemon to run as yourself? (yes/no) yes
 
Please enter the password for user 'User-Name':
Reenter:
*******************************************************************
* Warning: User mode mounts detected.  This will likely cause     *
* the service to fail to start.  You must have system mode mounts *
* in order to run services.  Re-run setup and choose 'All Users'  *
* or consult the FAQ for more information.                        *
*******************************************************************
Running cron_diagnose ...
... no problem found.
 
Do you want to start the cron daemon as a service now? (yes/no) yes
OK. The cron daemon is now running.
 
In case of problem, examine the log file for cron,
/var/log/cron.log, and the Windows event log (using /usr/bin/cronevents)
for information about the problem cron is having.
 
Examine also any cron.log file in the HOME directory
(or the file specified in MAILTO) and cron related files in /tmp.
 
If you cannot fix the problem, then report it to cygwin@cygwin.com.
Please run the script /usr/bin/cronbug and ATTACH its output
(the file cronbug.txt) to your e-mail.

For Windows 2003 Server

* Add a user called cron_server to run cron service

$ net user cron_server passwd /add /active:yes /fullname:"Cron Server" /comment:"Cygwin Cron Server"

* Add user cron_server to Administrators group

$ net localgroup Administrators cron_server /add

* Modify user cron_server rights

$ editrights -a SeAssignPrimaryTokenPrivilege -u cron_server
$ editrights -a SeCreateTokenPrivilege -u cron_server
$ editrights -a SeIncreaseQuotaPrivilege -u cron_server
$ editrights -a SeServiceLogonRight -u cron_server
$ editrights -a SeDenyInteractiveLogonRight -u cron_server
$ editrights -a SeDenyNetworkLogonRight -u cron_server
$ editrights -a SeDenyRemoteInteractiveLogonRight -u cron_server

* Sync up Cygwin passwd file
$ mkpasswd -l >

This entry was posted in cygwin. Bookmark the permalink.