#!/bin/sh # Find all logs that show no changes and remove them for LOGFILE in ${HOME}/cvslogs/* ; do if [ ! -d "${LOGFILE}" ]; then NUMLINES=`grep -v '^[\?M].*' "${LOGFILE}" | wc -l` if [ ${NUMLINES} == 0 ] ; then rm "${LOGFILE}" fi fi done # Store the last years cvslogs in a subfolder on new year if [ X`date +%d%m` = X'0101' ]; then YEAR=`date +%Y` YEAR=$((YEAR - 1)) echo "Storing the logs from ${YEAR} to \"${HOME}/cvslogs/${YEAR}/\"" mkdir -p "${HOME}/cvslogs/${YEAR}" mv ${HOME}/cvslogs/cvs*${YEAR}* "${HOME}/cvslogs/${YEAR}/" fi