Solved

Take a incremental backup by RSYNC command

Posted on 2013-11-24
3
403 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 51

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses

623 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