I have 3 drives. For this purpose, we will call them A, B and C respectively.

A is 2 TB

B is 1 TB

C is 500 GB

I have already run

rsync -avz -progress A B

Now B is full and I want to move/copy what is not already on B from A to C

It really doesnt matter to me what happens to what is on A as I will reformat anyways.

  • You want to move it, or you want to copy it? – Flimzy Nov 30 '12 at 3:22
  • I just want to copy it. – cripto Nov 30 '12 at 3:23

Make a list of all the files on B, say with the the find command by going to that drive and running:

$ find . > files-on-b.xt

Then when you rsync from A to C, specify that list in the --exclude-from parameter:

$ rsync -avz --exclude-from=files-on-b.txt A C

You may need to futz with the prefixes in the list to makes sure it matches the format/relative directory that rsync is expecting from an exclude list. Always a good idea to run rsync with the -n option to see what it's about to do without actually doing it.

See rsync man page and this helpful blog post for more on --exclude-from.


You can make use of the --compare-dest option. This saves some time and space, as you don’t have to enumerate the whole contents of the first destination, and will work incrementally with many targets. Here’s how it works: After copying the contents from A to B, you run:

rsync -avz --compare-dest=/path/to/B /path/to/A/ /path/to/C/

rsync will use the contents of B to see what it has to transfer to C to make the copy of A complete. Anything which is already in B won’t be transferred. Note that absolute paths for --compare-dest are required, otherwise the path is taken as relative to the destination.

If you in any event have to split your destination further, you can compare to multiple previous targets by adding more --compare-dest arguments.

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.