Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rsync permissions question -- destination perms not properly applying [closed]

Tags:

This is what I'm trying to do:

rsync -rvl --chmod=ug=rwX,o=rX test /var/www 

and after I do it, here are the results I get:

drwxr-xr-x 

(Actually it's drwxr-sr-x, but that's probably not important ... is it?)

This, obviously is not what I want. I want the group to have write permissions, but for some reason, the rsync command isn't setting them.

Anyone have any ideas why not? Is there a mistake in my syntax? If it's helpful I'm transferring from OSX to Linux (Debian).

Update: Also, if it's helpful, when I enter umask, I get 0002. So that's not the problem.

like image 761
Philip Walton Avatar asked Nov 06 '10 19:11

Philip Walton


People also ask

Does rsync preserve permissions?

'rsync -a' option preserves the permissions, ownership, timestamp of files and folders that are to be transferred using rsync. This will synchronize the two folders or files and will also maintain the same timestamp as that of the source.

What is dry run in rsync?

What is rsync –dry-run? “–dry-run” option allows the rsync command to run a trial without making any changes—most of the time, this process the same output as the real execution. The rsync command is combined with various options to specify what the rsync command will do before someone can execute it.

Does rsync Skip existing files?

Rsync with --ignore-existing-files: We can also skip the already existing files on the destination. This can generally be used when we are performing backups using the –link-dest option, while continuing a backup run that got interrupted. So any files that do not exist on the destination will be copied over.

What does rsync flag do?

Using this flag, rsync will sync the contents recursively while preserving any symbolic, special/device files, modification times, file permissions, group, owner, etc.


1 Answers

--chmod overrides the sending side permissions, but if you don't specify -p or --perms as well then the destination defaults are used regardless (i.e. --chmod is ignored).

From man 1 rsync:

--chmod

This option tells rsync to apply one or more comma-separated "chmod" strings to the permission of the files in the transfer. The resulting value is treated as though it was the permissions that the sending side supplied for the file, which means that this option can seem to have no effect on existing files if --perms is not enabled.

like image 109
SimonJ Avatar answered Oct 28 '22 12:10

SimonJ