I've seen this topic spread about the forums, but never found a real answer or solution to fix the issue.
When running rsync from a batch, I receive this error message.
rsync -rzvhtSin --delete --partial --log-file=c:\rsynclog2.txt --password-file=/cygdrive/c/pw --partial-dir=partial --port=8873 --stats --progress user@server.com::"Module" "/cygdrive/c/path/"
password file must be owned by root when running as root
continuing without password file
It then prompts for a pw.
I have seen people say, chmod your pw file.
I have done this, doesn't work.
chmod -v 600 c:\pw
mode of `c:\\pw' changed to 0600 (rw-------)
I have seen people redirect the pw into the rsync command.
i.e. rsync -rzvhtSin --delete --partial --log-file=c:\rsynclog2.txt --password-file=/cygdrive/c/pw --partial-dir=partial --port=8873 --stats --progress user@server.com::"Module" "/cygdrive/c/path/" < c:\pw
This works, but is not going to work in my situation.
I did not experience this issue before upgrading to 4.0.4.
There has to be a solution to fix this issue.
Please, pretty please......help?
Windows XP SP3
I hate to beg but....
/begging
tk?
Ok, for XP/SP3, this occurs when
On Windows 2003 server this occurs when
Hope this helps.
Oliver.
Oliver,
Yes this did help.
First off, thank you.
Secondly, where did you find this information? I scoured to the ends of the Internet and couldn't find anything that states this.
Anyway, here's my situation and what works (now).
I run a bunch of scripts using the task scheduler to automate some backups.
I run all these scripts as the SYSTEM user, they get higher priority and are not visible on screen when run as SYSTEM, which is what I want.
My first script actually creates the pw file via:
code:
echo blahblahblah123>c:\pw
My second task doesn't run a batch file with rsync inside it (see issue1) it just runs the entire rsync command rsync -avz ..................................
(issue1) Running rsync within a batch file from scheduled tasks does not quit correctly. I have my tasks set to terminate if the machine becomes un-idle, windows terminates the batch script, but rsync continues to run in the background until it is finished (which I don't like).
If I could get Windows to terminate the batch script and terminate the rsync child as well, I'd be extremely happy.
It seems that having SYSTEM create this file is part of the problem.
If I go in and delete c:\pw and then recreate the file myself echo blahblahblah123>c:\pw Then run rsync, it goes off without a hitch.
I am curious what I could add to my batch script to switch the owner of c:\pw to a user that is not SYSTEM.
I automate these jobs on multiple machines, and going in to change the pw file on each one would be a lot of work, it would be easier to redistribute the jobs and have them "fix themselves" within the batch file.
I was developing the script on my XP SP3 workstation w/an admin account that was not administrator and everything worked. I moved the scripts to my 2003 server and I got stuck w/the "password file must be owned by root when running as root" problem. After tinkering around with cacls.exe, etc., it just dawned on my that it had to be a user rights issue. It wasn't quite that easy, since it took me several hours of trying various things before I got it to work.
BTW, I run my batch file from scheduled services and everything seems to work (no hanging processes). I started w/the stock cwrsync.cmd and modified the bottom part to this:
REM Start plink
START /MIN "PLINK_FOR_RSYNC" plink -v -i id_rsa.ppk -N -L 873:localhost:1873 -l someone 192.168.1.174
REM Sleep for 15 seconds to give plink enough time to finish
sleep 15
REM Iterate through filenames in filelist.txt and rsync them
for /F "delims=" %%i in (filelist.txt) do rsync -av %%i --log-file=rsync.log.txt --password-file=rsyncd.secrets username@localhost::wintest
REM Kill plink window
TASKKILL /T /F /FI "WINDOWTITLE eq PLINK_FOR_RSYNC*"
As you can see, I had help from another website w/this script. I'm using a passphraseless key with ssh to create the ssh tunnel to my backup server. I'm also using plink, since I couldn't get the ssh.exe that was included w/cwrsync to work properly. The id_rsa.ppk and the public key were created with puttygen . I saved the public key to a text file and used pscp to copy it to the backup server. At the backup server, I used ssh-copy-id to "install" the key.
I had several links in here, since the batch file was a modification of someone elses work, but for some reason, I could not post my message because of the spam filter. Lets see: http://aplawrence.com/Unixart/backup_rsync.html
The other links were:
http://www.visitusers.org/index.php?title=Configuring_SVN_on_Windows#Con...
and
http://justinsomnia.org/2007/09/playing-with-rsync-on-ubuntu/
Have a look at etc/fstab and make sure that all of your drives are listed with noacl option.
/cygdrive cygdrive ntfs override,binary,noacl 0 0
C:/progra~1\cwrsync / ntfs override,binary,noacl 0 0
C:/progra~1\cwrsync\bin /usr/bin ntfs override,binary,noacl 0 0
tk,
Does this look correct?
I've searched high and low about using the fstab file with the current version of rsync (I had no issues running nontsec with cwrsync ~3.1.0)
I'm not sure that my fstab is correct (probably isn't) but it's the best I could come up with (using conflicting information from the all over the internet).
Your input would be much obliged.
tk?