Running cron as a windows service for rsync
MachineDog
New
I have been attempting to setup cron as a service using cygwin/cygrunsrv so I can get rsync to run daily, and have been having trouble.
The service is running under my user as it would not run as a local system account. (I can't imagine why that might screw anything up but maybe it does.)
I attempted having rsync output to a .txt file as a log and it doesn't output anything. I've manually run rsync just fine in the past so I think the problem is with cron.
Here is my crontab file:
0 0 * * * rsync -ur /cygdrive/d/documents /cygdrive/g
0 0 * * * rsync -ur /cygdrive/d/photoalbum /cygdrive/g
I'm not sure if that crontab is correct but I'm pretty sure it is. The rsync part of it is.
Any ideas, new to using cron. :/
The service is running under my user as it would not run as a local system account. (I can't imagine why that might screw anything up but maybe it does.)
I attempted having rsync output to a .txt file as a log and it doesn't output anything. I've manually run rsync just fine in the past so I think the problem is with cron.
Here is my crontab file:
0 0 * * * rsync -ur /cygdrive/d/documents /cygdrive/g
0 0 * * * rsync -ur /cygdrive/d/photoalbum /cygdrive/g
I'm not sure if that crontab is correct but I'm pretty sure it is. The rsync part of it is.
Any ideas, new to using cron. :/
0
Comments
( touch /cygdrive/g/test )
Okay I will try something.
edit: No file is created.
1) did you edit your crontab file using crontab -e ?
2) are you sure you have permission to write to that location? You might want to try touching a file in your cygwin homedir.
3) try making rsync write a log file to your homedire also.
4) are you sure cron is running as a service?
1) Yes.
2) I made sure of that.
3) I will try that.
4) Yep, I checked a couple of different websites and they all had the same instructions.. I think there must be something simple wrong... :\
So this just backs up a users desktop and documents to their U:drive on the network server. It's a bat file that is run through windows scheduler. The files all exist on the network nothing is installed on a users computer.
So the directory just needs. The specific files for rysnc and cygwin and the .bat file of course...
backup.bat
cygwin1.dll
rsync.exe
http://lifehacker.com/5281024/nasbackup-makes-incremental-backups-easy
Thanks! I'll try this I imagine it should work.
What's the /B for?
Start application without creating a new window. The
application has ^C handling ignored. Unless the application
enables ^C processing, ^Break is the only way to interrupt
the application.
So it's about making things run in the background
Gotcha, thanks.