LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 04-06-2012, 05:33 AM   #1
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Rep: Reputation: 5
sync folders


Hello,

I have a requirement to have two folders in sync. The source is online and the destination is local. I am using Fedora16.

Currently I have added

rsync --recursive --delete source dest

to the /etc/rc.local. Is this the right way or is there any better efficient way to perform this?

Thanks
 
Old 04-06-2012, 06:09 AM   #2
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
To add to the above, why rsync takes forever even on fairly identical directories? My source is about 5G. When I first did my rsync it took about 20 min to perform. But it takes the same amount of time every time I do this. Am I missing something?

Thanks
 
Old 04-06-2012, 06:19 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Yes. You have to preserve the modification time to avoid rsync makes the synchronization again and again over the same files. The option to preserve timestamp is -t, but a more convenient way is by means of -a, that is a short way to specify multiple options (-a is equal to -rlptgoD, see rsync --help for a brief description of each option).
Code:
rsync -a --delete source dest
 
Old 04-06-2012, 07:36 AM   #4
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
Thanks colucix. I did not want the owner and group of the destination modified. But the -t option certainly helped. Thanks.

BTW the original question is still open. Is this is the right way of doing this? I am looking for something like Windows' 'available offline' option.

Thanks
 
  


Reply



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
Sync folders and sub-folders between two centos webservers baldur2630 Linux - Software 1 03-26-2012 01:50 PM
[SOLVED] Sync web folders with local folder lpallard Linux - Software 3 05-14-2010 03:24 PM
Sync a USB flash drive with HD folders, possible? Valandil Linux - General 9 03-14-2010 11:16 PM
Sync files not folders with rsync (non recursive) ehlers Linux - Software 7 03-11-2009 09:53 AM
Sync Mail-folders (IMAP) Baumi Linux - Networking 4 12-20-2005 04:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 05:25 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
Open Source Consulting | Domain Registration