LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-01-2009, 08:20 AM   #1
lin*x
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.

Cheers,
Mark
 
Old 10-01-2009, 10:28 AM   #2
Myiagros
Member
 
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, 11:35 AM   #3
lin*x
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, 09:16 AM   #4
smeb
LQ Newbie
 
Registered: Aug 2013
Distribution: Debian and Ubuntu
Posts: 2

Rep: Reputation: Disabled
Smile

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, 04:36 PM   #5
mengoshmink
Member
 
Registered: Nov 2003
Distribution: Fedora
Posts: 42

Rep: Reputation: 3
Talking

Helped me, thanks smeb
 
  


Reply


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 08:39 AM
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 02:10 PM
chmod 775 to only the directories and chmod 664 to only the files? apachenew Linux - Security 6 09-27-2007 04:26 PM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 05:23 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 06:37 AM


All times are GMT -5. The time now is 04:29 AM.

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