LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 11-23-2011, 03:51 PM   #1
euphoricrhino
LQ Newbie
 
Registered: Nov 2011
Posts: 1

Rep: Reputation: Disabled
RSYNC Help - Copy Only Changed Files to New Directory


Hello everyone. I'm having an issue achieving the result I want using rsync. This is the scenario I'd like to achieve:

I pull the contents of a directory from a remote system, and store that in directory called "Baseline". I then recheck that remote system periodically and pull back ONLY the files that have changed, and place them into another directory called "Diff-<date>". In a more graphical representation, this is what I'm looking for:

Remote Server: File1 File2 File3

I run rsync and populate the Baseline folder, with:
Baseline: File1 File2 File3

Then, something changes on the remote server.
Remote Server: File1 File2 File3 File4 NewDirectory

I want to compare whats now on the server, with the contents of Baseline, and place only those changes in the Diff folder, so I'd only end up with the following in Diff:

Diff-<date>: File4 NewDirectory

Then if I recheck the remote system again, and notice another change, I want to be able to compare that and again add only that changed file to a new Diff-<date> folder.

I've tried various methods with rsync to create these incremental backups, and while they do work and contain the changed files, it also contains all the other files as well.

So as of now, if I have:
Remote Server: File1 File2 File3

And run rsync, I get
Baseline: File1 File2 File3

If remote server changes to:
Remote Server: File1 File2 File3 File4 NewDirectory

I end up with
Diff-<date>: File1 File2 File3 File4 NewDirectory

Instead of
Diff-<date>: File4 NewDirectory

If remote server changes again to
Remote Server: File1 File2 File3 File4 NewDirectory NewDirectory2

I end up with
Diff-<date>: File1 File2 File3 File4 NewDirectory NewDirectory2

Instead of the following, as I'd like
Diff-<date>: NewDirectory2

Hopefully that makes sense. Is there any way around this, or is rsync not the right method?

I have a BASH script written now, that when I run it, it creates incremental backups and places them into a folder. Is there a way to compare those incremental backups with one another, and then just copy out the changed files? One thing I noticed with my bash script now is that the incremental backups seem to be a revision behind. So if I make a change, it gets sync'd to the destination folder, and then an incremental backup is created of the previous states. When i run the script again, then the newest change is populated into another incremental backup. This may be normal operation, but im not sure.

Thanks for the help.
 
Old 11-23-2011, 04:29 PM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
hi,

maybe if you have done it so far with rsync you could use rdiff-backup which implements use of rsync.

good luck.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync copying everything not only changed files with luks encrypted drive changcheh Linux - General 1 09-10-2011 10:44 PM
using rsync to copy only certain folders within a directory structure Ryanjon7 Programming 5 06-20-2011 03:34 PM
[SOLVED] shell script to copy newly changed files with rsync genderbender Programming 15 04-22-2010 08:27 AM
Copying whole changed files - rsync? deadlock Linux - Software 2 12-04-2007 05:57 AM
rsync syntax to skip directory, but copy select files.. tnicol Linux - Software 3 07-24-2007 06:40 AM


All times are GMT -5. The time now is 02:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration