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?
Opening CrontabUse the crontab -e command to open your user account's crontab file. Commands in this file run with your user account's permissions. If you want a command to run with system permissions, use the sudo crontab -e command to open the root account's crontab file.
Go to Start > Control Panel > Scheduled Tasks. Right-click on the KMP cron task and click Properties. Then click the Schedule tab on the window with cron task properties. You'll see the schedule.
You need to also install cygrunsrv
so you can set cron up as a windows service, then run cron-config
.
If you want the cron jobs to send email of any output you'll also need to install either exim
or ssmtp
(before running cron-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
".)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With