Solved

Take a incremental backup by RSYNC command

Posted on 2013-11-24
3
379 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now