#!/bin/bash
#
LOGDIR=/var/log
LOGFILE=haproxy.log
TARDIR=/data/log
#
LOGDIRFILE=${LOGDIR}/${LOGFILE}
cp $LOGDIRFILE ${TARDIR}/${LOGFILE}.`date +%Y%m%d_%H%M%S`
cat /dev/null > $LOGDIRFILE
exit
===== crontab entry =====
Include this /etc/crontab
00 00 * * * root /var/log/logroll