HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] Newbie requests answers on maintainance



> Q1: What commands and parameters should I specify to delete faxes (*tif
> files and corresponding log entries) that are n days old?

You can use faxcron to delete your received files; however, I changed my
cron.daily script to add more functionality. It archives both the received tiffs
(recvq/*.tif) and the log files (log/c*) daily and then compresses them into
gzipped tarballs for storage:

#!/bin/sh

/usr/sbin/faxcron | mail -s "Hylafax Usage Report" faxmaster
/usr/sbin/faxqclean

# Stop hylafax and kill all incomming faxes
/etc/rc.d/init.d/hylafax stop > /dev/null 2>&1
/usr/bin/killall faxgetty

INSTDIR=/var/spool/hylafax
cd ${INSTDIR}/archive

# Get yesterday's date to archive all recieved faxes & logs
DATE=`/bin/date -I --date="yesterday"`
mkdir -p ${DATE}/{recvq,log}

# Move all recived faxes & logs to archive directory; reset counters
mv ${INSTDIR}/recvq/*.tif ${DATE}/recvq/
echo 0 > ${INSTDIR}/recvq/seqf
mv ${INSTDIR}/log/c* ${DATE}/log/
echo 0 > ${INSTDIR}/log/seqf

# Tarball archive directory from two days ago for storage
DATE=`/bin/date -I --date="2 days ago"`
if [ -e ${DATE} ]; then
    tar -zcf ${DATE}.tgz ${DATE}
    rm -rf ${DATE}
fi

# Delete 7 day old archives
DATE=`/bin/date -I --date="7 days ago"`
if [ -e ${DATE}.tgz ]; then
    rm -f ${DATE}.tgz
fi

/etc/rc.d/init.d/hylafax start > /dev/null 2>&1 &

exit 0




____________________ HylaFAX(tm) Users Mailing List _______________________
 To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null




Project hosted by iFAX Solutions