File permission umask howto?
Scott Howard
scott at doc.net.au
Thu Apr 4 07:35:42 EST 2002
On Wed, Apr 03, 2002 at 10:23:38AM -0500, Ted Zlatanov wrote:
> Scott Howard <scott at doc.net.au> writes:
>
> > Numeric modes are not currently supported (ie, --chmod 0755). Although they
> > would be easy to add, I'm not sure if it's a good idea or not? It really only
> > make sense if you're only copying single files - as soon as you start copying
> > directories it's going to get messy trying to use the same modes for
> > dirs and files.
>
> Instead of just --chmod, you probably want --file-chmod and
> --dir-chmod as well. The logic can get hairy, but there definitely
> should be a distinction, so we don't end up making files executable
> unnecessarily. --chmod should override the other two, I think, rather
> than trying to overlay permissions. That would simplify the logic.
This would be trivial to implement, but I'm really not sure it's needed.
This option is akin to the chmod -R command, and it doesn't allow this
distinction. As far as making files executable, thats where +X comes
in - it allows you to set/reset exec permissions if and only if it already
exists for at least one of user, group or other. eg :
<<scott at milliways tmp>> ls -l
total 16
drwx------ 2 scott users 69 Apr 4 07:33 test1
-rw------- 1 scott users 536 Apr 4 07:33 test2
<<scott at milliways tmp>> chmod a+rX test1 test2
<<scott at milliways tmp>> ls -l
total 16
drwxr-xr-x 2 scott users 69 Apr 4 07:33 test1
-rw-r--r-- 1 scott users 536 Apr 4 07:33 test2
Scott.
More information about the rsync
mailing list