No luck with rsync

Asked by Jim Hutchinson on 2008-02-26

I must be doing something wrong. I have been moving files from an old drive to a new drive in a rather piecemeal way and I've lost track of what I still need to copy. I thought rsync would be the answer but when I do a dry run it shows me that it would copy files that already exist on the new drive. Why? The command I'm using is

rsync -av --exclude=.* --ignore-existing --dry-run /media/oldhome/jim /home/jim

I've also tryed with -rv instead but no difference I can see. I added --ignore-existing to try and avoid this but it still happens. I don't want it to overwrite existing files so I'm reluctant to actually do it (i.e. without the --dry-run option).

Any idea what I'm doing wrong?


Question information

English Edit question
Ubuntu rsync Edit question
No assignee Edit question
Solved by:
Jim Hutchinson
Last query:
Last reply:
Revision history for this message
Jim Hutchinson (jphutch) said :

Via a separate communique it was suggested I include a trailing / on the source. The reason being that without it, rsync will copy the content to a new folder in the destination rather than syncing with the contents. In other words, the source would be copied to /home/jim/jim. With the trailing / it looks like

rsync -av --exclude=.* --dry-run /media/oldhome/jim/ /home/jim

That was successful and I consider this solved. Maybe that will be helpful to someone else someday.