Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
cancel
Showing results for 
Search instead for 
Did you mean: 

rsync incremental backup

Maaz
Valued Contributor

rsync incremental backup

I am using rsync to mirror directory

rsync -av /data /backup

/data is source and /backup is destination

right now I have only single /backup that is obviously exactly the same as /data,
but I want to keep /backup of each day(like incremental backup) e.g /backup of Monday, and /backup of Tuesday, and /backup of Wednesday etc via rsync.

i.e in short how can I use rsync to take incremental backup of /data

Regards
Maaz
5 REPLIES
Goran Koruga
Honored Contributor

Re: rsync incremental backup

Hi.

Take a look at rdiff-backuo.

Regards,
Goran
Steven E. Protter
Exalted Contributor

Re: rsync incremental backup

Shalom Maaz,

rsync is really good about taking changed files and making the /backup look like production with minimum band width.

If there are 5000 files in the source system and during the day only 50 of them changed, then rsync will only copy over the 50 that were changed.

But at backup time /backup will look like the production system.

Good for restore, but not an incremental backup.

Here is a way to take an incremental.

find /data -mtime -1 -exec cp -pr /backup {}


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ivan Ferreira
Honored Contributor

Re: rsync incremental backup

Why do you want to do it with rsync? If you want to have different backup versions, you should use "incremental" backups.

Probably, it's better to use "star" to perform remote incremental backups.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jimmy Vance
HPE Pro

Re: rsync incremental backup

There is an example of exactly what your trying to do listed on the rysnc examples psge at samba.org

http://rsync.samba.org/examples.html




__________________________________________________
No support by private messages. Please ask the forum!      I work for HPE

If you feel this was helpful please click the KUDOS! thumb below!   
Maaz
Valued Contributor

Re: rsync incremental backup

>Take a look at rdiff-backuo
Hi Goran Koruga thanks for help, sorry didnt checked 'rdiff-backup' yet, but as soon I got time, I will definitely check, and then I will also submit point to your post.


>Here is a way to take an incremental.
>find /data -mtime -1 -exec cp -pr /backup {}
Hi SEP, thanks for help
and help me in this(following) issue
test-back:/devel_x098 # find /devel_x098/AchDev_dvl1/ -mtime -1 -type f -print
/devel_x098/AchDev_dvl1/M AHSAN/text/16BIT_roof108_ROOF.jpg
/devel_x098/AchDev_dvl1/M AHSAN/text/New Folder/Thumbs.db
/devel_x098/AchDev_dvl1/M AHSAN/text/New Folder/brick222225.psd
/devel_x098/AchDev_dvl1/ADEEL AHMED/STATUS REPORT OF 09-07-09.ods

test-back:/devel_x098 # find /devel_x098/AchDev_dvl1/ -mtime -1 -type f -exec cp -rv bck/ {} \;
cp: cannot overwrite non-directory `/devel_x098/AchDev_dvl1/M AHSAN/text/16BIT_roof108_ROOF.jpg' with directory `bck/'
cp: cannot overwrite non-directory `/devel_x098/AchDev_dvl1/M AHSAN/text/New Folder/Thumbs.db' with directory `bck/'
cp: cannot overwrite non-directory `/devel_x098/AchDev_dvl1/M AHSAN/text/New Folder/brick222225.psd' with directory `bck/'
cp: cannot overwrite non-directory `/devel_x098/AchDev_dvl1/ADEEL AHMED/STATUS REPORT OF 09-07-09.ods' with directory `bck/'

test-back:/devel_x098 # ls bck/
test-back:/devel_x098 #

test-back:/devel_x098 # find /devel_x098/AchDev_dvl1/ -mtime -1 -type f -exec cp -v bck/ {} \;
cp: omitting directory `bck/'
cp: omitting directory `bck/'
cp: omitting directory `bck/'
cp: omitting directory `bck/'
test-back:/devel_x098 # ls bck/
test-back:/devel_x098 #

the 'bck' is empty.

actually this(/devel_x098) is a samba server share(windows xp users access this directory)...and I have to take regular backups of this directory(/devel_x098)

>Why do you want to do it with rsync? If you want to have different
>backup versions, you should use "incremental" backups.
HI Ivan Ferreira, thanks for help
Yeah I do agree with you, but I dont know why but neither I can take incremental backups via 'find' nor I can take incremental backups via 'tar'

e.g
tar -zc -g bck/snapshot_file -f /bck/bck_full.tar.gz /devel_x098

then I create some new files under /devel_x098, and modify some of the already existing files.
but when I take the new backup(incremental) its again a full/complete backup and not the incremental backup, I did the following

tar -zc -g bck/snapshot_file -f /bck/bck_$(date '+%d-%m-%Y').tar.gz /devel_x098

the above command creates another backup but not the incremental but another full/complete backup

du -h bck/*.tar.gz
2.5G bck_full.tar.gz
2.5G bck_25-07-2009.tar.gz

thats why I am trying to take inc backup via rsync.
I would love and appreciate if you guys help me in taking incremental backups via 'tar' and/or 'find'.

>http://rsync.samba.org/examples.html
Hi Jimmy Vance, thanks for help.
Yes I am reading the website ... and will try to implement ..let see.

Regards
Maaz