Subversion Repositories programming

Rev

Rev 89 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/bin/bash

###############################################################################
NZB_DIR="/home/irasnyd/downloads/nzb"
LOG_DIR="/home/irasnyd/downloads/usenet/logs"
BAD_FILE="${LOG_DIR}/nzbget_bad.txt"
COMPLETE_FILE="${LOG_DIR}/nzbget_complete.txt"
BMSG="*** Something Bad: "
###############################################################################

MY_PWD="$(pwd)"

echo "Starting at: " "$(date)" >> ${COMPLETE_FILE}

cd "${NZB_DIR}"

for i in *.nzb
    do ( nzbget "${i}" && rm "${i}" ) || echo "${BMSG}" "${i}" "$(date)" >> ${BAD_FILE}
    echo "${i}" >> ${COMPLETE_FILE}
done

echo "Ending at: " "$(date)" >> ${COMPLETE_FILE}

cd ${MY_PWD}