2

For a long time I was using windows. I have a separate drive I use to keep copies of my media files, photos etc. on, which I periodically backup to an external drive. In Windows I used SyncToy to do this. After my Windows stopped booting, I decided to switch to Linux (Ubuntu 10.10). That seems to be going fine, but now I want to backup my drive to the external drive like before.

Mostly the two drives will be already the same with maybe about 10GB of extra files added.

So I try to use rsync to synchronise the two drives like this:

rsync --dry-run -rvlt --modify-window=1 /media/Antonio1TB/Backup /media/FREECOM\ HDD/Backup

The problem is the dry run indicates that every file on the drive will be copied. Not just the files I have recently added.

What is the correct command to synch two NTFS drives under Ubuntu so that files that already exist don't get copied again? Thanks.

3 Answers 3

2

After additional research I think I partially figured out the problem. What the command above will do is copy the directory Backup on the source into Backup in the destination. But what I really wanted to do was copy the files and directories in Backup to the destination directory. In other words I needed a forward slash at the end

rsync --dry-run -rvOlt --modify-window=1 /media/Antonio1TB/Backup/ /media/"FREECOM HDD"/Backup

I also added the -O option. Without this rsync seems to want to copy directories even if no files in them have changed. I'm kind of puzzled by this option and exactly what it is doing in this situation and why it is needed.

1
  • 1
    Using -O, --omit-dir-times the modification time of directories won't be copied to the destination, even if it was updated on the original directory. Glad you solved your problem, you should accept your own answer to the question.
    – GnP
    Jul 12, 2013 at 21:20
2

If modification times and such are not important (permissions can not be preserved on ntfs), I use the --size-only option which will compare sizes alone and ignore files that differ only by modification time.

E.g.:

rsync --size-only -r /mnt/original /mnt/ntfs/backup/ # -in for "pretend mode"
1

Comparing sizes of the files alone might lead to problems. If a newer, modified file got the same size as the previous, older version, but despite this differ in content, then it will not be synced, though it should be.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .