Blame | Last modification | View Log | RSS feed
#!/bin/bash################## CONFIG OPTIONS ##############################################DLDIR="/home/irasnyd/downloads/usenet" # "global" download dir ###GLOGDIR="/home/irasnyd/downloads/usenet/logs" # "global" logdir ###################################################################################### Clean up global logs ###cleanup_logs() {rm -f ${GLOGDIR}/badfiles;rm -f ${GLOGDIR}/unextractable;};### Function which prints error logs ###print_errors() {### Print Unrepairable ###echoif [ -f ${GLOGDIR}/badfiles ]thenecho '****************************************'echo '*** THE FOLLOWING WERE UNREPAIRABLE ****'echo '****************************************'echocat ${GLOGDIR}/badfileselseecho 'No Unrepairable Files!'fiecho### Print Unextractable ###if [ -f ${GLOGDIR}/unextractable ]thenecho '****************************************'echo '*** THE FOLLOWING WERE UNEXTRACTABLE ***'echo '****************************************'echocat ${GLOGDIR}/unextractableelseecho 'No Unextractable Files!'fi};### Set/Clean up the Environment ###CUR_PWD=`pwd`cd ${DLDIR}cleanup_logs### The loop for subdirectories. It calls rarslave.current on every directory ##################################################################################find ./ -type d -print0 | xargs -0 -n1 | xargs -ISUBDIR bash -c 'cd "SUBDIR";echo "################################################################################"echo "Working in $(pwd)";echo "################################################################################"rarslave.current;echo "################################################################################"echo "Done in $(pwd)";echo "################################################################################"'################################################################################### Go back to old pwd ###cd ${CUR_PWD}### Print Parting Messages ###print_errorsechoecho "All Finished. Good Bye!"