Commit 18ff6147 authored by Valentin Samir's avatar Valentin Samir

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

parent 16dedbbe
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment