Skip to content

Instantly share code, notes, and snippets.

@MattLoyeD
Created October 28, 2015 15:19
Show Gist options
  • Save MattLoyeD/ec3a72830452dd61ab35 to your computer and use it in GitHub Desktop.
Save MattLoyeD/ec3a72830452dd61ab35 to your computer and use it in GitHub Desktop.
Copy new music files to a folder
#!/bin/bash
extarray=( mp3 flac ogg wmv wav ) ;
HOME=$1;
DESTINATION=$2;
#if [ $HOME == "/" || $HOME == $DESTINATION ] { exit 1 }
cd $HOME;
for i in "${extarray[@]}"
do
find ./ -iname "*.$i" -exec cp -nrv --parents \{\} $DESTINATION \;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment