rsync question
Preston Hagar
prestonh at gmail.com
Thu Dec 12 18:06:31 UTC 2013
On Thu, Dec 12, 2013 at 8:50 AM, R Kimber <richardkimber at btinternet.com>wrote:
> I've been using rsync to create an exact backup copy of my music
> collection onto another disk. I recently decided that I wanted to change
> the directory structure of the collection and, to prevent rsync having to
> spend hours deleting and copying the large files between the disks, I spent
> some time making the changes manually on each disk. However, the next time
> the backup script ran rsync it ran for five hours. The two disks were
> identical.
> So what was it doing? Or, rather, what was I doing wrong? I've clearly
> misunderstood rsync. I thought that if it saw two identical file structures
> it wouldn't actually do very much other than make a note of the new
> structure, which even for half a TB shouldn't take all that long.
>
> - Richard.
> --
> Richard Kimber
>
> --
>
It depends on what flags you sent rsync. Usually, rsync uses file size
and modified times to see if a file is different. For things like a text
document, this can be useful because you could change a word, the file size
stay the same, and the modification date change, meaning you need to update
your other copy. With things like music files, modification times aren't
as important.
If you try again, some options to look into:
-n this does a dry run, so you can throw it in until you are ready. You
can look at the output and guage if it has tons of changes or just a few to
see if you are getting it right.
--size-only this will skip files if they match in size and ignore
modification times.
-c this will skip files based on doing a checksum instead of using size
and modification times. It would be more accurate to make sure the file is
the same vs --size-only, but generally is slower since you have to generate
checksums for each file
rsync is really flexable, but if you are not careful can also do things you
don't want. I highly recommend you do a dry run with -n before running any
new rsync command, just to make sure you aren't going to accidentally
delete all your remote destination files or something like that.
Hope this helps,
Preston
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20131212/b6909f5f/attachment.html>
More information about the ubuntu-users
mailing list