Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- echo "Looking for files that are not allowed"
- find -type f ! -name "*.[r0][0-9a][0-9r]" -a ! -name "*.[ns]f[ov]" -a ! -name "*.avi" -a ! -name "*.jpg" -a ! -name "*.vob" -a ! -name "*.png" -a ! -name "*.mkv"
- find -type f -name "imdb.nfo" -o -name "kolla.nfo" -o -name "mdb.nfo" -o -name "*(1)*" -o -name "*(2)*" -o -name "*bad-[0-9]*" -o -name "*~*"
- echo ""
- echo "Looking for files with duplicate extentions"
- find -type f -name "*.avi.avi" -o -name "*.nfo.nfo" -o -name "*.sfv.sfv" -o -name "*.rar.rar"
- echo ""
- echo "Looking for missing files or corrupt sfv"
- cfv -rimVV
- echo ""
- echo "Looking for misplaced nfos"
- find -type f -name "*.nfo" ! -iname *fix* | grep CD[0-9]
- find -type f -name "*.nfo" ! -iname *fix* | grep -i sample
- echo ""
- echo "Looking for nfo's that are too big"
- find -type f -name "*.nfo" -size +50k
- echo ""
- echo "Looking for misplaced jpgs/pngs"
- find -type f -name "*.jpg" | egrep -vi 'sample|proof|cover'
- find -type f -name "*.png" | egrep -vi 'sample|proof|cover'
- echo ""
- echo "Looking for jpgs/pngs that are too small"
- find -type f -name "*.jpg" -size -10k
- find -type f -name "*.png" -size -10k
- echo ""
- echo "Looking for multiple nfo's or sfv's in same directory"
- find -type f -name "*.nfo" -printf "%h\n" | sort | uniq -c | sort | sed -e 's/^\ \+//' | grep -v ^1
- find -type f -name "*.sfv" -printf "%h\n" | sort | uniq -c | sort | sed -e 's/^\ \+//' | grep -v ^1
- echo ""
- echo "Looking for missing nfo's"
- BASEDIR=`pwd`
- find -name "*.[r0][0a][r1]" -printf "%h\n" | egrep -vi 'subs|sample|cover|extra|proof' | sed -e 's/CD[0-9]$//' | sort -u | while read DIR
- do
- cd "$DIR"
- if ! [ -f *nfo ]
- then
- echo $DIR
- fi
- cd "$BASEDIR"
- done
- echo ""
- echo "Looking for missing sfvs in subs dir"
- BASEDIR=`pwd`
- find -type d -iname *sub* | while read DIR
- do
- cd "$DIR"
- if [ ! -f *sfv ]
- then
- echo $DIR
- fi
- cd "$BASEDIR"
- done
- echo ""
- echo "Looking for duplicate samples"
- BASEDIR=`pwd`
- find -type d -iname "*sample*" | while read DIR
- do
- cd "$DIR"
- if [ $(ls *avi | wc -l) -gt 1 ]
- then
- if [ "$(md5sum *avi | awk '{ print $1 }' | sort | uniq -cd)" != "" ]
- then
- echo $DIR
- fi
- fi
- cd "${BASEDIR}"
- done
- echo ""
- echo "Looking for empty files/dirs"
- find -empty
- echo ""
- echo "Looking for missing samples (movies may need to be added to ~/lists/repacks.txt)"
- BASEDIR=`pwd`
- find -name "*.[r0][0a][r1]" -printf "%h\n" | egrep -vi 'subs|subpack|fix|cover|sample|extra|proof' | sed -e 's/CD[0-9]//' | sed -e 's/^\.\///' -e 's/\/$//' | sort -u | while read DIR
- do
- if ! grep -q "$DIR" ~/lists/repacks.txt
- then
- cd "$DIR"
- if [ ! -d Sample ]
- then
- echo "$DIR"
- fi
- cd "${BASEDIR}"
- fi
- done
- echo ""
- echo "Looking for misplaced samples"
- find -type f -name "*.avi" | egrep -vi 'sample|proof'
- echo ""
- echo "Looking for misnamed CD directories"
- find -type d | grep -i cd[0-9] | grep -v CD
- echo ""
- echo "Counting number of files versus sfv per directory"
- BASEDIR=`pwd`
- find -name "*sfv" -printf "%h\n" | while read DIR
- do
- cd "$DIR"
- NUMFILESDIR=`find -maxdepth 1 -mindepth 1 -type f | egrep -v 'sfv$|nfo$' | wc -l`
- NUMFILESSFV=`cat *sfv | grep ^\[0-9a-zA-Z] | wc -l`
- if [ $NUMFILESDIR -ne $NUMFILESSFV ]
- then
- echo "$DIR (DIR: $NUMFILESDIR - SFV: $NUMFILESSFV)"
- fi
- cd "$BASEDIR"
- done
- echo ""
- echo "Looking for corrupt samples"
- find -type f -name "*.avi" -exec ln -s `pwd`/{} ~/.wine/drive_c \;
- wine c:\AVIMAster.exe c:\*.avi > samples.log
- echo ""
- fromdos samples.log
- cat -A samples.log | sed -e 's/\$$//' > 1
- mv 1 samples.log
- grep -B60 Error samples.log | grep -i ^C\: | sed -e 's/C\:\\//i' | sort
- rm ~/.wine/drive_c/*.avi
- rm samples.log
- echo ""
Add Comment
Please, Sign In to add comment