cleanup remaining logs properly when requested

This commit is contained in:
George Danchev 2011-07-11 08:31:03 +00:00
parent e1aa125c05
commit 506656f5e9

View File

@ -95,11 +95,11 @@ fi
if [ "${CLEANUP_LOG}" -eq 1 ]; then if [ "${CLEANUP_LOG}" -eq 1 ]; then
if [ -f "${CLOG}" ]; then if [ -f "${CLOG}" ]; then
rm -f "${CLOG}" rm -f "${CLOG}"
echo -ne "\n${SELF}: Removed my own log ${CLOG}." | tee -a ${CLOG} echo -ne "\n${SELF}: Removed my own log ${CLOG}." # | tee -a ${CLOG}
fi fi
if [ -f "${CLOG}".prev ]; then if [ -f "${CLOG}".prev ]; then
rm -f "${CLOG}".prev rm -f "${CLOG}".prev
echo -e "\n${SELF}: Removed my own log ${CLOG}.prev." | tee -a ${CLOG} echo -e "\n${SELF}: Removed my own log ${CLOG}.prev." # | tee -a ${CLOG}
fi fi
else else
E2=`date '+%s'` E2=`date '+%s'`
@ -146,14 +146,14 @@ fi
echo -e "${SELF}: See diff against previous log file (might be long):" | tee -a ${CLOG} echo -e "${SELF}: See diff against previous log file (might be long):" | tee -a ${CLOG}
echo -e "diff -Naur ${CLOG}.prev ${CLOG} | less" | tee -a ${CLOG} echo -e "diff -Naur ${CLOG}.prev ${CLOG} | less" | tee -a ${CLOG}
fi fi
fi fi
# #
which tput >/dev/null 2>&1 && tput smso which tput >/dev/null 2>&1 && tput smso
echo -e "${SELF}: Leaving the following cruft in ${GEN_DATA_DIR}:" | tee -a ${CLOG} echo -e "\n${SELF}: Leaving the following cruft in ${GEN_DATA_DIR}:" # | tee -a ${CLOG}
which tput >/dev/null 2>&1 && tput rmso which tput >/dev/null 2>&1 && tput rmso
ls -lth "${GEN_DATA_DIR}" # | tee -a ${CLOG}
ls -lth "${GEN_DATA_DIR}" | tee -a ${CLOG}
# Fin # Fin
exit 0 exit 0