Solved

Take a incremental backup by RSYNC command

Posted on 2013-11-24
3
396 Views
Last Modified: 2013-11-29
Hi Expert,

Need a rsync  script which take backup modify files only.I've created  some folders in /.

ubuntu12:~$ tree /xerox
/xerox
|-- hr
|   `-- user1
|       `-- 5.txt
|-- iT
|   |-- user2
|   |   `-- 3.txt
|   `-- user3
|       |-- 1.txt
|       `-- 2.txt
`-- PA
    `-- user4
        `-- 4.txt

# rsync --force --ignore-errors --delete --backup --backup-dir="date +%d-%m-%y' -av /source /destination

Now when i'm run script first time it's take a full backup.
next time i do some changes in user1 file (5.txt).
Now i've ran again script.that time it first take backup of orignal one in date backup folder & overwrite changes in user1 file.

Now i want to do, rsync take only modified file backup in backup folder.Don't make a backup of original file.
(if you know another utilities which run on terminal please share)
If anybody know about it....please reply
0
Comment
Question by:xeroxzerox
3 Comments
 
LVL 29

Assisted Solution

by:MikeOM_DBA
MikeOM_DBA earned 166 total points
ID: 39675287
Rsync finds files that need to be transferred using a "quick check" algorithm (by default) that looks for files that have changed in size or in last-modified time. Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file's data does not need to be updated.
0
 
LVL 20

Assisted Solution

by:Daniel McAllister
Daniel McAllister earned 166 total points
ID: 39675297
The options you're using that have rsync creating the backup files are the --backup and --backup-dir entries. However, you're also using the --delete option, which means that once the date changes, your backups will be removed. (the only valid bacup folder will be the one with the current day's date).

It seems clear that English is not your first language... since there is no significant limit to the number of characters you can use, might I suggest that you pose your question in your native tongue, then supply the result of a translation (for example, from translate.google.com) underneath the original.

That way, I (or another expert) can read the English, and if it doesn't make sense to us, we can refer back to the original language text to try to decipher what you're asking.

Thanks!

Dan
IT4SOHO
0
 
LVL 50

Accepted Solution

by:
Steve Bink earned 168 total points
ID: 39675499
As I understand your question, you want to do one of two things:

1) Take a backup of only files that have changed since the last rsync.  Use the -u option for this.

2) Exclude original files from all backups after the first.  In this case, you'll need to run the first full backup, then use a different set of options for all future backups.  The second command used for the future backups should use the --exclude or --exclude-from options.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question