22 lines
496 B
Bash
Executable File
22 lines
496 B
Bash
Executable File
#!/bin/bash
|
|
mediaspi ()
|
|
{
|
|
if [ -z $1 ]; then
|
|
echo "usage: $0 $DIR_NAME";
|
|
return 1;
|
|
fi;
|
|
BINAME="collector_bin";
|
|
DEST="$HOME/perso/${BINAME}";
|
|
DIR="${1}";
|
|
mkdir -p $DEST;
|
|
mkdir $DIR;
|
|
if [ $? -ne 0 ]; then
|
|
echo "$DIR exists, must be deleted (will be anyway)";
|
|
return 1;
|
|
fi;
|
|
find . -type f -regextype egrep -iregex ".*$MEDIA_REG" -exec cp --parents -u {} -t $DIR \;;
|
|
cp -apu $DIR -t $DEST;
|
|
rm -rf $DIR
|
|
}
|
|
mediaspi "$@"
|