I would like to synchronize files from the folder /media/alex/Disk1/Movies to the folder named /media/alex/Disk2/Movies. I want to copy each file from /media/alex/Disk1/Movies or a subdirectory to the correct position /media/alex/Disk2/Movies, if it does not exist. The size and the time attributes of the files do not matter.

For example, I have a single file that exists only on Disk1: /media/alex/Disk1/Movies/Experimental/test.avi, so only this single file should get copied to /media/alex/Disk2/Movies/Experimental.

I have tried using the syntax

rsync -v -n -auv  --list-only /media/alex/Disk1/Movies  /media/alex/Disk2/Movies

but it lists all files in the directory '/media/alex/Disk1/Movies', even the ones that exist under /media/alex/Disk3/Movies. How to get the rsync Syntax right?



rsync -n -auv --size-only /media/alex/Disk1/Movies/  /media/alex/Disk2/Movies

and if that does what you want, you can remove the -n argument

Some explanation:

  • --size-only makes sure you do not have to touch the movies in the destination folder to do checksumming and you don't care if the time is different (since the content of the movie files does not change, this should be OK)
  • the syntax of rsync can be a bit confusing. In your example, you omitted the / behind /media/alex/Disk1/Movies, which will actually copy the whole Movie-folder into the OTHER Movie-folder (so it will be /media/alex/Disk2/Movies/Movies)
  • I thought I tried that one before, but maybe I used an extra '/' or something... – Alex Apr 9 '15 at 19:56
  • @Alex yes, bad things will happen if you omit the '/'. You could, however, use rsync -n -auv --size-only /media/alex/Disk1/Movies /media/alex/Disk2 – Slizzered Apr 9 '15 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.