Details |
Last modification |
View Log
Rev |
Author |
Line No. |
Line |
1 |
root |
1 |
#!/bin/sh
|
64 |
franck |
2 |
# $Id: alcasar-log-clean.sh 642 2011-06-21 20:26:37Z franck $
|
1 |
root |
3 |
# script de nettoyage des archives supérieures à 1 an ( 365 jours)
|
|
|
4 |
DATE=`date +%F`
|
|
|
5 |
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/"
|
|
|
6 |
delay=365
|
|
|
7 |
|
|
|
8 |
for i in $REP
|
|
|
9 |
do
|
642 |
franck |
10 |
find $i \( -mtime +$delay \) -a \( -name '*.gz' -o -name '*.sql' -o -name '' -o -name 'gpg' \) -exec rm -f {} \;
|
1 |
root |
11 |
done
|
|
|
12 |
|
|
|
13 |
exit 0
|