backup of files which will be replaced during rsync
hello,
i want to take a backup of those files which will be replaced during rsync. i.e. newer or modified files in source will replace older files in destination, so i want to take the backup of the older files in the destination itself. is it possible using rsync?? |
probably this helps: http://webgnuru.com/linux/rsync_incremental.php
|
If you want to have access to the files in their older versions, rsnaphot or rdiff-backup can do it. Rsnapshot uses rsync internally.
|
Incremental backup would take the backup of files which have been changed i.e. the newer files. But in my case I need to backup the files which will be over-written i.e. the older files.
|
sorry guy, I do not understand. Those files will be lost if you did not make a backup before modification.
|
yeah i know that once rsync is done the older data is lost. But before running the rsync command is there a way to just take backup of the files that will be changed?
|
ever looked at how "git" works. I mean your just adding to something then making a commit. then you will be able to go back to backup at will. you will be able to choose any of the times you put somthing in the git and commit.
and if you do branches and after a while you no longer need that branch you can delete it. say branch-2013 and you will no longer need it get rid of it. you already have a brach-2014 started. but that is a nice way of backing up and being able to look at changes. |
Quote:
|
Quote:
In other words, he has machine A and machine B. Machine A backs up to B using rsync A backup is performed on Sunday "filename.txt" on machine A is changed on Monday Before he runs the rsync to sync up A and B, he wants to make a backup of "filename.txt" on B, so that when the backup is done, B has both copies of "filename.txt", the new one that matches A, and the old one from Sunday. OP - look into the --link-dest flag in rsync. The basic idea is that you would perform a full backup from A to some dated directory on B, then the next time you did the backup, you would set --link-dest to the previous backup. Then when the backup is performed, any files that are UNCHANGED on the source, would simply be hard linked from the previous backup on the destination, while any files that are changed on the source are copied like normal. In the end, you have two full backups, one from the previous day and one from the current day, but it only takes up the hard drive space of one backup plus any files that changed between the two backups, since the unchanged files are hard-linked between the two. |
Good description from suicidaleggroll, and rsnapshot is designed to automate exactly that. So if your concern is solely about disk usage with multiple backup time points, and you have many small files which do not change very often, this could be a solution.
It is not the right tool for often-changing large files like vm images, though. |
All times are GMT -5. The time now is 04:18 AM. |