Hi all,
I liked the rsync utility for sync and backup in ubuntu.
e.g. rsync -arH <source> <destination> would backup files in archive mode(-a), recursively(-r) and preserve hard links(-H). Using this, destination is modified based upon the filesize differences.
How do I make rsync to take backup based on latest modified time, doesn't matter if destination file size is larger or smaller than the source file? Anyone have suggestion to use some other/better sync and backup utility than rsync?
Any help would be appreciable.
Thanks, Sagar Belure
2011/4/14 Sagar Belure sagar.belure@gmail.com:
Using this, destination is modified based upon the filesize differences.
How do I make rsync to take backup based on latest modified time, doesn't
Your understanding of rsync is incorrect. From rsync(1):
"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."
Binand
On Thu, Apr 14, 2011 at 5:24 PM, Binand Sethumadhavan binand@gmail.comwrote:
2011/4/14 Sagar Belure sagar.belure@gmail.com:
Using this, destination is modified based upon the filesize differences.
How do I make rsync to take backup based on latest modified time, doesn't
Your understanding of rsync is incorrect. From rsync(1):
"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."
Ok. Pardon my misunderstanding, but it still says that, "....files that have changed in size or in *last-modified time*...."
Or, if not rsync I wish to fulfill my requirement. Is there any other utility that would do the job for me?
I take regular backup for the files and folders. I had been doing it manually. Or maybe I should think of making a bash myself?
Please suggest.
Thanks, Sagar Belure
Binand
2011/4/14 Sagar Belure sagar.belure@gmail.com:
Pardon my misunderstanding, but it still says that, "....files that have changed in size or in *last-modified time*...."
Or, if not rsync I wish to fulfill my requirement.
What is your requirement then? I thought you wanted to use mtime always irrespective of file size. That's precisely what rsync does, as per the man page - it says, paraphrasing, IF localsize != remotesize OR localmtime != remotetime THEN process the file. That is, IF localsize == remotesize AND localmtime == remotemtime THEN (and only then) leave the file alone. From the last one, it is evident that if the mtimes differ, rsync will process the file irrespective of what the sizes are.
Binand
On Thu, Apr 14, 2011 at 6:15 PM, Binand Sethumadhavan binand@gmail.comwrote:
2011/4/14 Sagar Belure sagar.belure@gmail.com:
Pardon my misunderstanding, but it still says that, "....files that have changed in size or in *last-modified time*...."
Or, if not rsync I wish to fulfill my requirement.
What is your requirement then? I thought you wanted to use mtime always irrespective of file size. That's precisely what rsync does, as per the man page - it says, paraphrasing, IF localsize != remotesize OR localmtime != remotetime THEN process the file. That is, IF localsize == remotesize AND localmtime == remotemtime THEN (and only then) leave the file alone. From the last one, it is evident that if the mtimes differ, rsync will process the file irrespective of what the sizes are.
Sorry for late reply. I don't remember, what I was doing during testing, was confused. It does its job as expected.
Apology for bothering, and thanks Binand for your help.
Thanks, Sagar Belure