I recently attempted to install cron for cygwin in our TEST environment, and found the process extremely difficult. I've actually ended up restoring the servers to a previous date to erase all that I had done, but I still want to have another go at this. When I did install cron, I also upgraded all the portions of cygwin that were installed on our systems, which may have caused most of the issues I had. The main issue I had with cron was with the file permissions under /var/cron/tabs/user (kept getting a BAD FILE MODE error in my cronbug.txt file)
What I was wondering is if anyone out there has successfully installed cron for cygwin in a Luminis environment (we're running IV.0.1), what obstacles did you encounter and how were they overcome? In addition to cron, what other upgrades did you implement for cygwin? Any and all help would be greatly appreciated.
Thanks
Jonathan
Comments
Cygwin and Cron
Am I correct in that you are running L****** on a Windows box? Installing Cygwyn and then installing Cron in Cygwyn would just emulate a Unix environment, correct?
You could get around your issues in a few ways:
1) Use crontab on a true Unix box and run your commands remotely through a SSH tunnel.
2) Place your scripts inside the Windows Task Scheduler instead.
I apologize if I am overlooking something elementary.
Installing Cygwin Cron
It took several attempts to get cron working on my Windows 2003 (SP2) machines, but I finally found a method that worked well.
After you have downloaded the approprate packages using the Cygwin setup program, run the following commands from a Cygwin shell:
net user cron_server /add /yes
net localgroup Administrators cron_server /add
editrights -a SeAssignPrimaryTokenPrivilege -u cron_server
editrights -a SeCreateTokenPrivilege -u cron_server
editrights -a SeIncreaseQuotaPrivilege -u cron_server
editrights -a SeServiceLogonRight -u cron_server
mkpasswd -l -u cron_server >> /etc/passwd
editrights -a SeDenyInteractiveLogonRight -u cron_server
editrights -a SeDenyNetworkLogonRight -u cron_server
editrights -a SeDenyRemoteInteractiveLogonRight -u cron_server
cygrunsrv -I cron -p /usr/sbin/cron -a -D -d "Cygwin cron" -e "CYGWIN=tty ntsec" -u cron_server -w
This creates a separate cron_server user to run the service and grants that user the appropriate rights. (replace with a password of your choosing. Then it limits what that user can do beyond just running the service. Finally, it installs cron as a Windows service. If you have a previous failed install of cron, then you will need to go find and delete the /var/log/cron.log file or the service won't start.
I also have the ssh daemon running on my Windows boxes and it works well. That was also a somewhat tricky installation, but it is very useful, especially for Unix admins whose institutions have chosen to go with Windows.