So I start my copy session, it may be music, movies or ISO's, just whatever data I feel like messing around with that particular day. I used this command:
cp /path/to/data/* /path/to/destination
This works great, for all the files in a folder, it does not however copy subdirectories or the contents of the subdirectories. To copy this, we need to add the -R switch to our copy command. It now looks like this:
cp -R /path/* /destination/
This looks and works better, until you move your laptop to the other side of the room and forget to move the USB drive along with the laptop, oops, I just disconnected my drive during a copy...
Now what, delete the folders from the destination and start over, that is what I used to do, then I learned some helpful switches, now my copy commands look like this:
cp -uRav /path/* /destination/
All of the switches are important here, the "u" tells the copy command that it should only copy over the destination file if the source is newer or the destination file is missing, the "v" is verbose, so you can watch the file list scroll up the screen while the copy process is working. The "a" is for archive, this makes sure that the destination has the same attributes/permissions/ownership as the source file.
Just another lesson learned.
Published with Blogger-droid v1.6.7
No comments:
Post a Comment