Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
672 richard 1
#!/bin/bash
64 franck 2
# $Id: alcasar-log-clean.sh 672 2011-07-08 15:34:22Z richard $
672 richard 3
 
4
# alcasar-log-clean.sh
5
# by Franck BOUIJOUX
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
8
# nettoyage des archives supérieures à 1 an (365 jours)
9
# delete backup files older than one year (365 days)
10
 
1 root 11
DATE=`date +%F`
12
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/"
13
delay=365
14
 
15
for i in $REP
16
do
642 franck 17
	find $i \( -mtime +$delay \) -a \( -name '*.gz' -o -name '*.sql' -o -name '' -o -name 'gpg'  \) -exec rm -f {} \;
1 root 18
done
19
 
20
exit 0