rsync - setting file permissions problem
You cannot change the file timestamps or change permissions by being a member of a group, you have to be the file owner, or root. If you cannot be the other of that file, you might need to avoid trying to set permissions at all. You can do this with the perms option (after your other options because -a
includes a bunch of stuff including the positive of this) like so:
rsync -az --no-perms
You can see some discussion about the underlying systems involved on this related question.
Related videos on Youtube
TheVillageIdiot
Updated on September 18, 2022Comments
-
TheVillageIdiot over 1 year
I am using rsync to synchronize folders between two Ubuntu Lucid Lynx systems.
rsync -az --delete -e "-i /home/ruser/.ssh/id_rsa_ruser -p 200" /usr/local/folder/ [email protected]:/usr/local/backup/folder/
Everything is going fine except I am getting following problem:
rsync: failed to set permissions on "/usr/local/backup/folder/README.txt": Operation not permitted (1)
On remote system (192.168.1.2)
ruser
is member oftnr group
which is owner of/usr/local/backup/folder/
. The folder's permissions are as follows:drwxrwxr-x 3 tom tnr 188416 2011-06-20 18:04 folder
Please help me to resolve the error or any method to bypass changing permission setting by rsync.
EDIT:- I had sorted this out by creating group tnr on source server and setting it as owner of source folder.
-
TheVillageIdiot almost 13 yearsThanks but I had sorted out it some other way, but will definitely give this a try next time. Moreover I was not able to find --no-perms on any man page hosted on various sites, which I was looking for.
-
user3376703 almost 13 yearsIt's in the GNU rsync man page.
--no-OPTION
is described as a way to turn off options that were implied by others (such as-a
). The--no-perms
possibility is specifically mentioned as a likely candidate for this.