Forum » Operacijski sistemi » logrotate - prepend dateext
logrotate - prepend dateext
HotBurek ::
Pozdrawwwljeni.
Je komu uspelo najti rešitev, kjer bi logrotate dodal dateext na začetku imena fajla?
Torej, da bi se access-https.log preimenoval v 2020-08-01-access-https.log?
Ker trenutno dateext doda string na koncu imena, in ne najdem možnosti, da bi ga dal na začetku.
/etc/logrotate.d/nginx config:
Je komu uspelo najti rešitev, kjer bi logrotate dodal dateext na začetku imena fajla?
Torej, da bi se access-https.log preimenoval v 2020-08-01-access-https.log?
Ker trenutno dateext doda string na koncu imena, in ne najdem možnosti, da bi ga dal na začetku.
/etc/logrotate.d/nginx config:
/var/log/nginx/www.slo-tek.cum/*.log {
daily
dateext
dateformat -%Y-%m-%d
missingok
rotate 52
#compress
nocompress
#delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
endscript
}
root@debian:/# iptraf-ng
fatal: This program requires a screen size of at least 80 columns by 24 lines
Please resize your window
fatal: This program requires a screen size of at least 80 columns by 24 lines
Please resize your window
- spremenilo: HotBurek ()
HotBurek ::
Hvala za namig. Ko sem videl "endscript", sem naštudiral, da če že uporabljam cron, zakaj ne bi potem kar Python skripto štartal (1 0 * * *). Dela ko šus. In še v log fajl si pišem.
root@debian:/# iptraf-ng
fatal: This program requires a screen size of at least 80 columns by 24 lines
Please resize your window
fatal: This program requires a screen size of at least 80 columns by 24 lines
Please resize your window

Invictus ::
Lahko pa ponucaš syslog-ng, pa tam to narediš, in še zraven filitriraš vso nepotrebno navlako iz log fila...
"Life is hard; it's even harder when you're stupid."
http://goo.gl/2YuS2x
http://goo.gl/2YuS2x
Zgodovina sprememb…
- spremenil: Invictus ()
Vredno ogleda ...
| Tema | Ogledi | Zadnje sporočilo | |
|---|---|---|---|
| Tema | Ogledi | Zadnje sporočilo | |
| » | Fix skripte: nginx log + group by user-agent + count + sort descOddelek: Programiranje | 875 (798) | Invictus |
| » | Debina9 Apache2 | ./configure, make, make installOddelek: Operacijski sistemi | 815 (701) | HotBurek |
| » | Postavitev mySQLOddelek: Programiranje | 2501 (2079) | M01O |
| » | problem pri sprembi root gesla v MySQL v UbuntuOddelek: Pomoč in nasveti | 1417 (997) | killa bee |
| » | [js] json kompresijaOddelek: Programiranje | 4358 (3707) | infiniteLoop |