#!/bin/sh
# Takes /var/spool/qmailscan/quarantine.log and rotates it to /var/log/qss-logs;
# then it zeros the quarantine.log file.
# Under GPL 2.0 and above.
# Written by hip0
 
month_num=`date +%m`;
quarantine_log_base=/var/log/qss-logs;
q_log_file=quarantine.log;
q_log_base_f=/var/spool/qmailscan/quarantine.log;
if [ -s $quarantine_log_base/$q_log_file ] ; then
(cd $quarantine_log_base; /bin/cp $q_log_file $q_log_file.$month_num);
if [ -s $log_base_f ]; then
cat /dev/null > $q_log_base_f; 
fi

fi

exit 0

