Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've finally got an old computer of mine running as a backup server with Ubuntu 11.10. I'm planning on using it to backup my Windows 7 machine weekly using rsync. I've got cygwin installed, and rsync works perfectly. I'm following this guide, though, to create it as a scheduled task:

http://justinsomnia.org/2007/02/how-to-regularly-backup-windows-xp-to-ubuntu-using-rsync/

I have an rsync.bat script in C:\, and I can get the script to run correctly if I run it directly from the command line in Cygwin. However, when I try to run the rsync.bat script, I get this:

ERROR: password file must not be other-accessible

So it must be permissions issues on the secret file...I followed that guide and set the permissions to 600, and chowned it to Nate[the administrator]:SYSTEM.

Any ideas on what might be causing the problem?

EDIT: The file in question is actually on the Windows 7 machine. I figured I should ask here, since I'm dealing specifically with Cygwin and Rsync.

After some googling, I found that there is a "strict modes" option that tells rsync not to check the permissions on the secret files, and that was added to accomodate Windows systems. However, after adding it and restarting the rsyn daemon, I still seem to be getting the same error. Here's my rysncd.conf file:

[rsync]

path = /home/nate/backups
comment = My backups
uid = nate
gid = nate
read only = false
auth users = nate
secrets file = /etc/rsyncd.secrets
strict modes = false

And the permissions on the secrets file, according to cygwin:

-rw-------  1 Nate SYSTEM   11 Dec  9 18:48 secret

I feel like I must be missing something really obvious.

share|improve this question
    
Is your filesystem NTFS or FAT? FAT32 filesystems do not support individual file permissions. –  maxmackie Dec 14 '11 at 18:31
    
Sorry, I don't think I clarified. The secret file that's giving me issues is the one on the Windows 7 machine, that's in the cygdrive. So it's NTFS. –  Nate Dec 14 '11 at 18:35

3 Answers 3

up vote 0 down vote accepted

I was able to fix this issue by changing the password-file line to the following:

–password-file=/cygdrive/c/cygwin/secret

share|improve this answer

Make sure to do the following:

1) Change mode of the password file to -rw------- , for example having a password file C:/Custom/syncjob/pwfile on Windows, using Cygwin, go to password file location:

cd /cygdrive/c/Custom/syncjob

and then

chmod 600 ./pwfile

2) Also change ownership of the password file to the user that is executing the rsync job, for example 'Dave':

chown Dave ./pw

3) It might help to refer to password file as -password-file=/cygdrive/c/... like Nate wrote.

I don't think it is necessary to change rsync configuration.

A known workaround for Windows is to append

< pwfile

to the end of the rsync command.

Good luck.

share|improve this answer

None of the above helped. Finally I found that the line endings of pwfile should read as follows:

$ od -c pwfile
0000000   s   e   c   r   e   t   s  \n     (Unix)
NOT
0000000   s   e   c   r   e   t   s  \r  \n (Windows)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.