Some cygwin commands are .exe
files, so you can run them with the standard Windows Scheduler, but others don't have an .exe
extension so can't be run from DOS (it seems like).
For example I want updatedb
to run nightly.
How do I make cron work?
I figured out how to get the Cygwin cron service running automatically when I logged on to Windows 7. Here's what worked for me:
Using Notepad, create file
C:\cygwin\bin\Cygwin_launch_crontab_service_input.txt
with contentno
on the first line andyes
on the second line (without the quotes). These are your two responses to prompts forcron-config
.Create file
C:\cygwin\Cygwin_launch_crontab_service.bat
with content:Add a Shortcut to the following in the Windows Startup folder:
Cygwin_launch_crontab_service.bat
See http://www.sevenforums.com/tutorials/1401-startup-programs-change.html if you need help on how to add to Startup. BTW, you can optionally add these in Startup if you would like:
Cygwin
XWin Server
The first one executes
and the second one executes
You need to also install
cygrunsrv
so you can set cron up as a windows service, then runcron-config
.If you want the cron jobs to send email of any output you'll also need to install either
exim
orssmtp
(before runningcron-config
.)See
/usr/share/doc/Cygwin/cron-*.README
for more details.Regarding programs without a
.exe
extension, they are probably shell scripts of some type. If you look at the first line of the file you could see what program you need to use to run them (e.g., "#!/bin/sh
"), so you could perhaps execute them from the windows scheduler by calling the shell program (e.g., "C:\cygwin\bin\sh.exe -l /my/cygwin/path/to/prog
".)