Copy files to USB drive. How to verify?
Hello All
I'm backing up my data into a USB external hard disk in the gnome terminal. After the command finished the job, I entered the 'sync' command several times. How do I make sure all the files I copied using the cp command have been completely copied to USB drive and that they are not in cache/buffer? Thanks |
Couple of examples.
You could check the 2 dirs for difference. Code:
a="cow dog cat frog bear moose chicken rat pig" Code:
a=" man comm man diff I watch a system monitor whenever I copy many files to an external drive. When It's done writing to the external, it's done. If cp errors on something, it will tell you. |
Use the umount command to un-mount the USB. That will force any unresolved file handles to be resolved.
You do not need to issue sync, it helps, but the umount action will perform any actions similar to a sync call. Issuing it multiple times is no improvement though. |
"Like many core Linux commands, if the cp command is successful, by default, no output is displayed. To view output when files are copied, use the -v (verbose) option.
" https://www.computerhope.com/unix/uc...is%20destroyed. However unlike the dos -verify this only reports that it copied. It doesn't go back and compare the two files. So, cp may be the wrong program to use in your case. |
Quote:
https://www.linuxquestions.org/quest...ia-4175683939/ After five years of Linux use, it's an odd question to ask (twice). |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 02:48 AM. |