(Account no longer active) Posted August 11, 2015 Share Posted August 11, 2015 Could someone put me onto resources/provide an example for how to write a Linux shell script that copies a folder (ie. DCIM) from one USB drive drive to another, then checks and renames appropriately on the second drive (if 'DCIM1' exists, rename 'DCIM' to 'DCIM2'), then erases the contents of the DCIM folder on the original drive? With progress meter would be nice also. Also, is there a way to assign a particular USB drive as 'sdb5' permanently? Thanks in advance. Link to comment Share on other sites More sharing options...
Haggis Veteran Posted August 11, 2015 Veteran Share Posted August 11, 2015 so you can mount drves by using th UUID of the drive learn about that here http://www.cyberciti.biz/faq/linux-finding-using-uuids-to-update-fstab/ so if you have the drives mount to the same place all the time this is nice and easy to copy the files rsync -av --progress --ignore-existing /home/placewherefilesare/* /home/placetocopyto/ so --progress gives you a progress of whats happening --ignore-existing means it does an incremental backup so will ignroe files already existing that hae not changed once you are done to delete the old folder rm -rf /home/placewherefilesare does this point you in the right direction? Link to comment Share on other sites More sharing options...
Recommended Posts