SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have an odd problem. I'm running the following rsync command as root:
[code]
rsync -v -r -t --delete --partial /OHPRSstorage/Acronis/workstations/ /mnt/localBackup/Acronis/workstations
[code]
a source file on /OHPRSstorage/Acronis/workstations/common/is:
What is it that you want it to do? If you want to replicate all file permissions, user/group ownership etc, then vrt flags alone won't do it. If that's your goal, then try the following flags:
then vrt flags alone won't do it. If that's your goal, then try the following flags:
Yes, it looks like the -a flag is needed here to get the expected results. Or at least the -p option is needed to save permissions and it is included in the -a option.
That's how umask works. It only removes permissions, it doesn't add them. You might consider revisiting some basic Unix tutorials?
I don't think I agree with this statement. If I have umask 0022 and I `touch` a file, I get -rw-r--r--. In other words, it creates the file with o+r. It seems to me that rsync is *creating* files on the target directory (on the same computer) and in the absence of specify permissions it should create with the 0022 umask (but of course, it's not).
Quote:
Originally Posted by Turbocapitalist
Yes, it looks like the -a flag is needed here to get the expected results. Or at least the -p option is needed to save permissions and it is included in the -a option.
I've found a solutions, but neither the -a nor -p option are what I want. If you'll notice in my OP the source file permissions were -rw-rw----, meaning that -a or -p would keep those permission and I still wouldn't have o+r. To do this, I use:
Code:
rsync -v -r -t --chmod=o+r,Do+x
The 'D' flag is special and indicated setting 'x' for directories.
This works, but still doesn't explain why rsync doesn't use the user's umask to create the target files (if -a -p or --chmod are not specified). I guess that's just the way rsync works, so I'll not worry about it.
The umask is applied against whatever permissions the calling program requests. For new files, most programs, including touch, request 0666, so with a umask of 0022 the result is 0644. (Compilers that produce executable files generally request 0777.) The permissions that rsync requests for a new file are those of the source file, in this case 0660, and the result is 0640. The "-p" flag just causes rsync to ignore the umask and copy the source permissions exactly. Unless you use "--chmod", rsync never adds permissions that the source file did not have.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.