LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-09-2012, 12:48 PM   #1
rohit.dhaval1
Member
 
Registered: Jul 2009
Posts: 44
Blog Entries: 2

Rep: Reputation: 0
rsync usage to make one directory look exactly like other


Hi Folks..

I have a NFS volume that contains thousands of binaries. And, hundreds of machines make use of those binaries.

example : '/usr/sf' NFS volume --> /usr/sf/bin/vim (the binary)

I have installed lot of binaries on cloned volume '/usr/sf_clone' . I need to sync all the changes to '/usr/sf'

What options should I be using with 'rsync' to make sure copying takes place recursively, with privileges maintained. At end of rsync operations, '/usr/sf' should look exactly like '/usr/sf_clone' with no duplicate files /binaries.

--------------------

I am sorry, I haven't been able to contribute to LQ
 
Old 02-09-2012, 02:16 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Use the -a option to copy recursively and maintain privileges and the --delete option to delete files in /usr/sf that are not in /usr/sf_clone. So it would look like
Code:
rsync -a --delete /usr/sf_clone/* /usr/sf/
For more information on rsync have a look at
Code:
man rsync
 
1 members found this post helpful.
Old 02-09-2012, 02:51 PM   #3
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
I use the --delete option as well, you need to be extremely careful as you do not want to get your syntax of your command sideways as you will delete all of your data off of your production server.

Many a people have done this, like one of the posters profile states, (always have a backup) and of course test your commands on something not-production.
 
1 members found this post helpful.
Old 02-10-2012, 08:50 AM   #4
rohit.dhaval1
Member
 
Registered: Jul 2009
Posts: 44

Original Poster
Blog Entries: 2

Rep: Reputation: 0
Thank you guys !!.. I was aware of the command.. I wanted to cross check with gurus here as, data I am playing with is of high importance.

@rhbegin : Yes I have taken appropriate backup at storage level. Thanks again !!
 
Old 02-10-2012, 09:35 AM   #5
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
On TobiSGG profile

quote "Making a backup after having problems is like fastening the seatbelts after crashing into a wall."

I agree 100%

 
  


Reply

Tags
rsync



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
make rsync ignore directory structure? illumilore Linux - General 1 04-20-2011 12:46 AM
rsync memory usage over ssh tajamari Linux - Software 9 09-20-2007 05:52 AM
How to make RSYNC skip a directory due to error message ArchW Linux - Networking 5 07-13-2006 10:26 AM
rsync no such file or directory (2) baronsam Linux - General 6 06-01-2006 06:13 PM
rsync reduce cpu usage dtra Linux - Software 0 05-25-2005 08:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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
Open Source Consulting | Domain Registration