Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-01-2009, 07:20 AM   #1
LQ Newbie
Registered: Aug 2009
Posts: 15

Rep: Reputation: 1
Rsync Chmod Problem

Hi All,
Why isn't this rsync working as in... the file it copies across doesn't get given the chmod settings I've tried to set.

As i understood is the rsync chmod can also have D or F for file or directory however i didn't think it was absolutely necessary to use this... My rsync command works fine apart from the chmod......
rsync -zrltv --delete --force --chmod=u+rwX,g+rwX,o+rX,o-w

I'm trying to get files created at the target to be set with the perms 775 and directories with 775... hence why i haven't used the rsyncs D or F to specify either files or directories... maybe i have to do two separate ones??

I've downloaded and installed from source the latest rsync version yesterday as my previous rsync verison didn't have the chmod capability and that is what i was after.

Old 10-01-2009, 09:28 AM   #2
Registered: Mar 2009
Distribution: Ubuntu, CentOS 5.3
Posts: 75

Rep: Reputation: 18
You could rsync the files over then do a chmod on the parent directory if you are placing them in a new directory.
Old 10-01-2009, 10:35 AM   #3
LQ Newbie
Registered: Aug 2009
Posts: 15

Original Poster
Rep: Reputation: 1
I could, however there are a lot of files and that is not speedy. Hence why i was looking into --chmod with rsync hoping to not have to do what you are suggesting. As thats the current method and seems a bit on the nasty side of doing things. I'd rather have the rsync do what it says on the tin :-)

Thanks for your answer though it might help some people viewing the thread in the future.
Old 08-29-2013, 08:16 AM   #4
LQ Newbie
Registered: Aug 2013
Distribution: Debian and Ubuntu
Posts: 2

Rep: Reputation: Disabled

I know this is an ancient thread but it appeared quite high up the Google results for it, so figured I might as well chime in as I just wasted 10 minutes battling with this too!

The issue seems to be that rsync --chmod will happily ignore whatever you put, unless you put the --perms before the --chmod option. So:

rsync --perms -r --chmod=ugo+rwX src dest

will go through and set all files to read/write for ugo (user/group/other?), setting the execute bit for directories as required, and keeping the execute bit for already-executable files.

Hope this helps future visitors!
1 members found this post helpful.
Old 12-26-2013, 03:36 PM   #5
Registered: Nov 2003
Distribution: Fedora
Posts: 42

Rep: Reputation: 3

Helped me, thanks smeb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sticky Bit? (ie: chmod 2770 vs chmod 770) JeffC1 Linux - Newbie 7 03-18-2010 07:39 AM
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 01:10 PM
chmod 775 to only the directories and chmod 664 to only the files? apachenew Linux - Security 6 09-27-2007 03:26 PM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 04:23 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 05:37 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:36 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration