[firewall-logrotate-script] Changement du format de date de syslog
This commit is contained in:
parent
16dedbbe62
commit
18ff614750
1 changed files with 1 additions and 7 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue