Link to home
Start Free TrialLog in
Avatar of Mark
Mark

asked on

rsync not deleting, why?

I run the following command:

rsync -rvtO --delete myUser@myHost:/backup/\* /backup/folder/

It copies the files from the source host, but does not delete files in the destination folder that no longer exist on the source. I get no error message. This rsync version is 3.0.4  protocol version 30. The --delete option on other computers just fine. the rsync user does have permission in the /backup/folder directory because I was able to delete a file in that directory by-hand logged in as the rsync user. The /backup directory is a mounted external USB drive.


Any ideas?
Avatar of Mark
Mark

ASKER

more information:

I changed the rsync command to:

rsync -rvtO --delete myUser@myHost:/backup/ /backup/folder

When I ran this rsync command I got:

rsync: delete_file: unlink(2012-02-29-fullbackup.tgz) failed: Permission denied (13)

I checked the permissions on the file:

ls -l /backup/novatec/2012-02-29-fullbackup.tgz
-rw-rw-r-- 1 root backup 13017848257 2012-03-01 03:49 /backup/novatec/2012-02-29-fullbackup.tgz

Then I tried deleting the file manually and got:

rm /backup/novatec/2012-02-29-fullbackup.tgz
rm: remove write-protected regular file `/backup/novatec/2012-02-29-fullbackup.tgz'?

Now, the file is owned by root, and is in group 'backup', and has group rw permission. The user trying to rm the file is a member of group 'backup'. Why is it saying the file is "write-protected"? If I solve this mystery I should be able to get rsync working.
SOLUTION
Avatar of serialband
serialband
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mark

ASKER

Thanks for the effort.