I wanted to copy files from the Windows drive to external HDD using rsync, with the following command:
rsync -azv --progress --exclude-from '/home/mint/exclude.txt' '/media/mint/OS/' '/media/mint/external_hdd/C_drive_backup/'
In exclude.txt
I had Windows, Program Files and ProgramData folders, since I don't need them. So I initiated the command given above and went to sleep. When I woke up, here's what I got:
sent 169,748,362,821 bytes received 3,982,112 bytes 16,898,347.01 bytes/sec
total size is 193,085,110,161 speedup is 1.14
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.0]
So should I be worried that something didn't get copied? If I use the command du -hs /media/mint/OS/* | sort -h
and calculate the total size I should get, it's something around 187 GB (compared to rsync's output in bytes to gigabytes: 169,748,362,821
-> ~158GB
. 193,085,110,161
-> ~179GB
.)
Can I see which files/folders did not get copied? If I scroll up, I can see the last 200 lines and all of those have 100% completion.
Should I just copy the files again? Or is there a way to compare the files on external HDD and the Windows drive?
Best Answer
If you haven't saved the whole output from
rsync
, then the only way to find what wasn't copied is to run another traversal to compare. You might as well run rsync again: its whole point is not to transfer what has already been transferred. Don't pass the-v
parameter so that you won't be overwhelmed by boring output.(You can use
rsync -anq …
to compare without transferring, but if you've just made a copy, it won't copy anything again, so-n
doesn't make any difference in this scenario.)