In order to use
rsync I created a Bash script. It runs fine from the Cygwin 32-bit shell in Win 7 but fails when run from the Win 7 Task Scheduler. My Task Scheduler script is a simple:
c:\cygwin\bin\bash.exe -l -c "/home/user/rsync_Windows_Backup >> /home/user/Documents_cron.log 2>&1"
The initial directory for the job is set to
My Bash script is a typical
rsync [options] SRC DEST and some related housekeeping.
rsync command within my
rsync_Windows_Backup Bash script is:
/bin/time -f "\nElapse (hh:mm:ss.ss) %E" \ rsync.exe -ravuz --copy-links "$SRC" "$DEST" >> "$LOG" \ 2 >> "$LOG"
I tested the script from the Cygwin command line. It runs as expected, i.e.
$ ./rsync_Windows_Backup - succeeds.
However, the Task Scheduler job fails carping that it cannot find the DEST folder that the Bash script references. When I do a
cd DEST from the BASH command line the folder is available and can be written to, too.
I should add some more details, the sender is a Win 7 desktop that is mapped to a Vista desktop receiver with a drive mapping
J:. The Bash script does start but fails with:
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32) rsync: mkdir "/cygdrive/J/DocumentsBackup" failed: No such file or directory (2) rsync error: error in file IO (code 11)
I can remove the first error by changing the configuration to Windows 7 in the General Tab of the Task Scheduler properties. I cannot see why the
mkdir fails to see the share
To check the LAN connection I also did a
net use J: \\server\share. It connects fine and allows listing and writes, etc.
When I run the same task scheduler job in Windows Vista it does work fine.
Is this some finer NTLM issue or other permission issue on Win 7? I am stumped at the moment.