Subversion Repositories ALCASAR

Rev

Rev 642 | Blame | Last modification | View Log

#!/bin/bash
# $Id: alcasar-log-clean.sh 672 2011-07-08 15:34:22Z richard $

# alcasar-log-clean.sh
# by Franck BOUIJOUX
# This script is distributed under the Gnu General Public License (GPL)

# nettoyage des archives supérieures à 1 an (365 jours)
# delete backup files older than one year (365 days)

DATE=`date +%F`
REP="/var/log/squid/ /var/log/httpd/ /var/log/firewall/ /var/Save/base/ /var/Save/logs/firewall/ /var/Save/logs/squid/ /var/Save/logs/httpd/"
delay=365

for i in $REP
do
        find $i \( -mtime +$delay \) -a \( -name '*.gz' -o -name '*.sql' -o -name '' -o -name 'gpg'  \) -exec rm -f {} \;
done

exit 0