From 18ff614750637c867c580ca5462b0cfb1b8d567d Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sun, 23 Jun 2013 16:59:20 +0200 Subject: [PATCH] [firewall-logrotate-script] Changement du format de date de syslog --- firewall/firewall-logrotate-script.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/firewall/firewall-logrotate-script.sh b/firewall/firewall-logrotate-script.sh index c437e948..98ad7162 100755 --- a/firewall/firewall-logrotate-script.sh +++ b/firewall/firewall-logrotate-script.sh @@ -24,13 +24,7 @@ dernier_fichier=$logs_src/$(ls -tr "$logs_src" | grep -E 'logall\.log\.[0-9]+\.. #timestamp=$(bzcat "$dernier_fichier" | head -1 | awk '{print $1}') #date=$(date -d "1970-01-01 $timestamp sec" +"%Y-%m-%d") -Y=$(date | awk '{print $4}') -Y=${Y:0:4} -M=$(bzcat "$dernier_fichier" | head -1 | awk '{print $1}') -M=$(date -d "01-$M-01" +%m) -D=$(bzcat "$dernier_fichier" | head -1 | awk '{print $2}') -D=$(date -d "01-01-$D" +%d) -date=$Y-$M-$D +date=$(bzcat "$dernier_fichier" | head -1 | awk -F 'T' '{print $1}') [ -n "$QUIET" ] || { echo install -o root -g root -m 400 "$dernier_fichier" "$logs_dst/logall.log.$date.bz2" echo rm "$dernier_fichier"