|
|
Question : Need bash script to copy/update all files recursively under a certain size
|
|
I need to be able to copy all files/subdirectories from one particular directory on one drive to another drive... but only files / directories that do not already exist on dest drive or are older on dest drive... also exclude anything larger than 2gigs in size. Basically, like executing "cp -au /home/somedir /mnt/usb" but with the 2gig exception rule.
I know this is probably do-able with a well-crafted "find" command but I am not knowledgable enough to work it out.
|
Answer : Need bash script to copy/update all files recursively under a certain size
|
|
find /home/somedir -size -2147483648 | xargs -J {} cp -au {} /mnt/usb
|
|
|
|