Cron – How to run cron service in cygwin

croncygwinwindows 7

I have run installed cygwin with openssh, rysnc and cron. I've run cygserver-config and cron-config

cygcheck -c | grep cron
cron                      4.1-65                       OK

cygrunsrv -Q cron
Service             : cron
Current State       : Running
Controls Accepted   : Stop
Command             : /usr/sbin/cron -n

Windows recognized the service in the correct user context.
windows task manager
There are no errors in the windows event, cron or cygserver logs. Many resources on the internet insist to use cron-config instead of cygrunsrv -I cron -p /usr/sbin/cron -a -D or cygrunsrv -I cron -p /usr/sbin/cron --args -n. I tried all three. Every thing appears to have installed correctly with cron-config but cron jobs are not running.
here is an example of my crontab (yes, it is set to run every minute for debuging purposes!)

crontab -l
* * * * * rsync -avz -e "ssh -i /cygdrive/c/users/path/.ssh/id_rsa" foo.bar@ssh-target.com:/var/log/path/ /cygdrive/c/destination/path/ --progress

UPDATE:
looks like cron is now running and making entries in the windows event log. Unfortunately, now I am running into execution and context errors.
error 1
error 2

Best Answer

Inside crontab you should always run commands with full path; for rsync it should be

/usr/bin/rsync