LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 02-21-2012, 08:30 AM   #1
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Rep: Reputation: 1
rsync backup


Hi

i have centos 5.3 installed i use rsync to backup local to remote with rsync -avz -e "ssh -i /root/rsync-key" /sourcefolder/ root@remoteip:/destination folder/ . it also works properly
but i want to copy this data on destination with datewise incremental backup how it possible


AMAR

Last edited by amartlk; 02-21-2012 at 08:32 AM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-21-2012, 09:18 AM   #2
ba.page
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Scientific,Debian
Posts: 35

Rep: Reputation: 7
this is probably more involved than you expect since the notion of modified time or incremental are not built into rsync.
I figure you have to options:
option 1) setup a local backup process to generate weekly fulls and daily incrementals to a folder on your source pc. then rsync that backup folder to the destination.
depending on the distribution you're using, you may have access to a simple backup program that will handle the generation of backups for you. if you don't have access to pre-fabricated backup applications, you can make your own. I found a good guide here: http://www.linux-backup.net/Full_Inc/

option 2) is more complex and will require a lot of script. if found a decent guide here: http://www.howtoforge.com/rsync_incr...apshot_backups

good luck.
 
Old 02-21-2012, 04:26 PM   #3
wpeckham
Senior Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,657

Rep: Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584
Backup using rsync

Rsync is a wonderful tool for fast syncronization and backups, but not for datewise incrementals. What you need is a serious backup/restore tool.
 
Old 02-22-2012, 06:22 PM   #4
polinux
Member
 
Registered: Jun 2011
Location: Reading UK
Distribution: OpenSUSE, CenOS
Posts: 46

Rep: Reputation: 3
Bacula should be good for it. .
 
Old 02-22-2012, 08:18 PM   #5
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
Also, there is amanda (zmanda has a front-end interface) which makes configuration a lot easier.

We use Zmanda and it is a life saver when you need to restore critical files.
 
Old 02-22-2012, 11:21 PM   #6
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
rsync is a very useful and powerful program for doing incremental transfers of files, whether that is locally or remotely.
Suppose I want to backup to my USB memory stick so I have an up-to-date copy of them wherever I go. My source folder here is ~/Documents and my memory stick is mounted at /media/disk right now.

Initially, you will have to use rsync to copy all the files across, since an incremental copy doesn't yet exist.

Quote:
# rsync -avh ~/Documents /media/disk
That sets up an archive copy. Depending on how much stuff you have and where you're copying, it might take some time, but the verbose option we used (-v) should show you the name of each file as it is copied over.

Once that's done, you've got your initial copy done. Now when you need to synchronise the two copies, simply run the same command again. This time, rsync will go off and find only the files that have changed, and copy those over. When it has finished, both copies will then be up-to-date, and you can get back on the move.

Check these links also, helpful for incremental backups:
http://www.marksanborn.net/howto/use...nthly-backups/
http://www.linuxhomenetworking.com/f...-backup-script
http://fluff.info/blog/arch/00000204.htm

Last edited by Satyaveer Arya; 02-22-2012 at 11:23 PM.
 
2 members found this post helpful.
Old 02-23-2012, 10:28 AM   #7
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
One important aspect of rsync is using the --delete option because you do not want to leave files that were deleted.

Be very CAREFUL with using the delete as you do NOT want to purge the files on the source.

For a valid backup you would need to implement this, otherwise you will create a quagmire of non-valid data.

I have used the --delete option when migrating server to server, the end user never knows their data be it email, file_shares, ect... was ever migrated. Otherwise the end user will be inundated with data they do NOT want.

Last edited by rhbegin; 02-23-2012 at 10:32 AM. Reason: need to implement --delete option
 
Old 02-23-2012, 10:52 PM   #8
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
If you'd prefer both copies to remain completely synchronised, even if that means deleting files from either copy, add the --delete option, like so:

Code:
# rsync --delete -avh ~/Documents /media/disk
Do be careful with that option, however, as you don't want to be deleting things you might need.
 
Old 02-24-2012, 09:12 AM   #9
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
Quote:
Originally Posted by Satyaveer Arya View Post
If you'd prefer both copies to remain completely synchronised, even if that means deleting files from either copy, add the --delete option, like so:

Code:
# rsync --delete -avh ~/Documents /media/disk
Do be careful with that option, however, as you don't want to be deleting things you might need.
Correct and there is no 'undelete command' to run in case of 'oops'.

However, for backups to be valid they need to mirror what you are backing up. Otherwise you will have a quagmire of erroneous files.
 
  


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
LXer: Rsync Backup for Windows, Linux Knoppix, and Other Smart Technologies in Handy Backup by Novos LXer Syndicated Linux News 0 12-24-2011 12:43 PM
LXer: Backup with rsync and rsync.net LXer Syndicated Linux News 0 09-14-2010 05:20 PM
Using RSync to backup a secondary off-site backup server pezdspencer Linux - Software 4 06-29-2007 04:40 PM
Using rsync to backup data. Best way to backup folders? Micro420 Linux - General 2 11-23-2006 02:13 AM
rsync backup... tarballed Linux - Networking 10 06-27-2003 11:43 AM


All times are GMT -5. The time now is 10:38 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