Solved

Take a incremental backup by RSYNC command

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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
LogmeIn using Linux Ubuntu 16.04 6 180
Upgraded from Debian 7 to 8.7 and got black screen 20 121
How many users could squid support? 21 60
Golang on CentOS / Fedora 2 8
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

734 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