bash script to copy found directory and parent to another drive,

Karl Auer kauer at biplane.com.au
Sun Sep 14 08:58:08 UTC 2008


On Sat, 2008-09-13 at 23:44 -0400, Lance Hoffmeyer wrote:
> So find 
> /media/music/jazz/coltrane/ROIO
> /media/music/jazz/Davis/ROIO
> /media/music/rock/LedZep/ROIO
> 
> and copy them to 
> 
> /media/flash/jazz/coltrane/ROIO
> /media/flash/jazz/Davis/ROIO
> /media/flash/rock/LedZep/ROIO

cd /media/music
mkdir ../flash
cp --parents -a */*/ROIO ../flash

You don't need the second step if your flash directory already exists.

"--parents" is non-standard; don't expect this to work on other Unixes
necessarily.

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)                   +61-2-64957160 (h)
http://www.biplane.com.au/~kauer/                  +61-428-957160 (mob)

GPG fingerprint: DD23 0DF3 2260 3060 7FEC 5CA8 1AF6 D9E3 CFEE 6B28

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080914/e691c191/attachment.sig>


More information about the ubuntu-users mailing list