Created
September 13, 2013 02:13
-
-
Save JasonMillward/6546134 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
txtred='\e[0;31m' | |
txtprp='\e[1;35m' | |
txtgrn='\e[0;32m' | |
txtrst='\e[0m' | |
find /mnt/kronos -type f | while read -r line; do | |
if [[ $line == */Anime/* ]] | |
then | |
NEWPATH=$(echo $line | sed -e 's/kronos/apollo/g') | |
fi | |
FILENAME=$(basename "$line") | |
if [[ -z "$NEWPATH" ]] | |
then | |
echo -e "${txtred}[ ERROR ]${txtrst} \$NEWPATH not set" | |
else | |
mkdir -pv "$(echo $NEWPATH | sed -e "s/$FILENAME//g")" | |
rdd-copy -q -f -n 5 --progress 1 "$line" "$NEWPATH" | |
echo $NEWPATH | |
if [[ -f "$NEWPATH" ]] | |
then | |
echo -e "${txtgrn}[SUCCESS]${txtrst} $FILENAME" | |
else | |
echo -e "${txtred}[ Error ]${txtrst} $line" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment