[firewall-logrotate-script] Changement du format de date de syslog

This commit is contained in:
Valentin Samir 2013-06-23 16:59:20 +02:00
parent 16dedbbe62
commit 18ff614750

View file

@ -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}') #timestamp=$(bzcat "$dernier_fichier" | head -1 | awk '{print $1}')
#date=$(date -d "1970-01-01 $timestamp sec" +"%Y-%m-%d") #date=$(date -d "1970-01-01 $timestamp sec" +"%Y-%m-%d")
Y=$(date | awk '{print $4}') date=$(bzcat "$dernier_fichier" | head -1 | awk -F 'T' '{print $1}')
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
[ -n "$QUIET" ] || { [ -n "$QUIET" ] || {
echo install -o root -g root -m 400 "$dernier_fichier" "$logs_dst/logall.log.$date.bz2" echo install -o root -g root -m 400 "$dernier_fichier" "$logs_dst/logall.log.$date.bz2"
echo rm "$dernier_fichier" echo rm "$dernier_fichier"