wranger2
22.05.13, 09:41
Moin,
ich habe nen Syslogserver der von verschiedenen Geräten (Switche, Router, Linux) entsprechende Pakete entgegen nimmt. Das Funktioniert auch, nur möchte ich die auch entsprechend komprimieren. Da ich die IPs/Hostnamen aber nicht weiss, legt Syslog die Ordner automatisch an weswegen ich im Logrotatet mit Wildcards arbeiten muss.
Funktioniert auch so halb, hier erst mal die Syslog-Konfig:
cat /etc/logrotate.d/syslog
/var/www/syslog/*/* {
daily
rotate 14
compress
# delaycompress
create 700 www-data www-data
postrotate
/usr/bin/killall -HUP syslog-ng
endscript
}
/var/www/syslog/*/*/* {
daily
rotate 14
create 700 www-data www-data
compress
# delaycompress
postrotate
/usr/bin/killall -HUP syslog-ng
endscript
}
Allerdings erzeugt er mir immer Leerdateiene und packt die auch ganz komisch. Erwartet hätte ich:
other.log
other.log.1
other.log.2.gz
other.log.3.gz
Das macht er draus:
[ ] other.log 21-May-2013 08:07 4.5K
[ ] other.log.1.1.1 21-May-2013 06:26 0
[ ] other.log.1.1.1.1.gz 21-May-2013 06:26 0
[ ] other.log.1.1.1.1.gz.1.gz 20-May-2013 06:26 33
[ ] other.log.1.1.1.1.gz.2.gz 18-May-2013 06:31 33
[ ] other.log.1.1.1.2.gz 21-May-2013 06:26 0
[ ] other.log.1.1.1.2.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.1.1.1.2.gz.2.gz 16-May-2013 23:11 33
[ ] other.log.1.1.1.3.gz 21-May-2013 06:26 0
[ ] other.log.1.1.1.3.gz.1.gz 16-May-2013 23:11 20
[ ] other.log.1.1.1.4.gz 16-May-2013 23:11 29K
[ ] other.log.1.2.gz 21-May-2013 06:26 0
[ ] other.log.1.2.gz.1.gz 21-May-2013 06:26 0
[ ] other.log.1.2.gz.1.gz.1.gz 20-May-2013 06:26 33
[ ] other.log.1.2.gz.1.gz.2.gz 18-May-2013 06:31 33
[ ] other.log.1.2.gz.2.gz 21-May-2013 06:26 0
[ ] other.log.1.2.gz.2.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.1.2.gz.2.gz.2.gz 16-May-2013 01:22 33
[ ] other.log.1.2.gz.3.gz 21-May-2013 06:26 0
[ ] other.log.1.2.gz.3.gz.1.gz 16-May-2013 01:22 20
[ ] other.log.1.2.gz.4.gz 16-May-2013 01:22 24K
[ ] other.log.1.gz 21-May-2013 06:26 0
[ ] other.log.1.gz.1.gz 20-May-2013 06:26 734
[ ] other.log.1.gz.2.gz 18-May-2013 23:56 465
[ ] other.log.2.gz 21-May-2013 06:26 0
[ ] other.log.2.gz.1 21-May-2013 06:26 0
[ ] other.log.2.gz.1.1.gz 21-May-2013 06:26 0
[ ] other.log.2.gz.1.2.gz 21-May-2013 06:26 0
[ ] other.log.2.gz.1.2.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.2.gz.1.2.gz.2.gz 16-May-2013 06:29 33
[ ] other.log.2.gz.1.3.gz 21-May-2013 06:26 0
[ ] other.log.2.gz.1.3.gz.1.gz 16-May-2013 06:29 20
[ ] other.log.2.gz.1.4.gz 16-May-2013 06:29 33
[ ] other.log.2.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.2.gz.2.gz 18-May-2013 01:46 2.1K
[ ] other.log.3.gz 21-May-2013 06:26 0
[ ] other.log.3.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.3.gz.2.gz 19-May-2013 06:26 14K
[ ] other.log.4.gz 21-May-2013 06:26 0
ich habe nen Syslogserver der von verschiedenen Geräten (Switche, Router, Linux) entsprechende Pakete entgegen nimmt. Das Funktioniert auch, nur möchte ich die auch entsprechend komprimieren. Da ich die IPs/Hostnamen aber nicht weiss, legt Syslog die Ordner automatisch an weswegen ich im Logrotatet mit Wildcards arbeiten muss.
Funktioniert auch so halb, hier erst mal die Syslog-Konfig:
cat /etc/logrotate.d/syslog
/var/www/syslog/*/* {
daily
rotate 14
compress
# delaycompress
create 700 www-data www-data
postrotate
/usr/bin/killall -HUP syslog-ng
endscript
}
/var/www/syslog/*/*/* {
daily
rotate 14
create 700 www-data www-data
compress
# delaycompress
postrotate
/usr/bin/killall -HUP syslog-ng
endscript
}
Allerdings erzeugt er mir immer Leerdateiene und packt die auch ganz komisch. Erwartet hätte ich:
other.log
other.log.1
other.log.2.gz
other.log.3.gz
Das macht er draus:
[ ] other.log 21-May-2013 08:07 4.5K
[ ] other.log.1.1.1 21-May-2013 06:26 0
[ ] other.log.1.1.1.1.gz 21-May-2013 06:26 0
[ ] other.log.1.1.1.1.gz.1.gz 20-May-2013 06:26 33
[ ] other.log.1.1.1.1.gz.2.gz 18-May-2013 06:31 33
[ ] other.log.1.1.1.2.gz 21-May-2013 06:26 0
[ ] other.log.1.1.1.2.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.1.1.1.2.gz.2.gz 16-May-2013 23:11 33
[ ] other.log.1.1.1.3.gz 21-May-2013 06:26 0
[ ] other.log.1.1.1.3.gz.1.gz 16-May-2013 23:11 20
[ ] other.log.1.1.1.4.gz 16-May-2013 23:11 29K
[ ] other.log.1.2.gz 21-May-2013 06:26 0
[ ] other.log.1.2.gz.1.gz 21-May-2013 06:26 0
[ ] other.log.1.2.gz.1.gz.1.gz 20-May-2013 06:26 33
[ ] other.log.1.2.gz.1.gz.2.gz 18-May-2013 06:31 33
[ ] other.log.1.2.gz.2.gz 21-May-2013 06:26 0
[ ] other.log.1.2.gz.2.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.1.2.gz.2.gz.2.gz 16-May-2013 01:22 33
[ ] other.log.1.2.gz.3.gz 21-May-2013 06:26 0
[ ] other.log.1.2.gz.3.gz.1.gz 16-May-2013 01:22 20
[ ] other.log.1.2.gz.4.gz 16-May-2013 01:22 24K
[ ] other.log.1.gz 21-May-2013 06:26 0
[ ] other.log.1.gz.1.gz 20-May-2013 06:26 734
[ ] other.log.1.gz.2.gz 18-May-2013 23:56 465
[ ] other.log.2.gz 21-May-2013 06:26 0
[ ] other.log.2.gz.1 21-May-2013 06:26 0
[ ] other.log.2.gz.1.1.gz 21-May-2013 06:26 0
[ ] other.log.2.gz.1.2.gz 21-May-2013 06:26 0
[ ] other.log.2.gz.1.2.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.2.gz.1.2.gz.2.gz 16-May-2013 06:29 33
[ ] other.log.2.gz.1.3.gz 21-May-2013 06:26 0
[ ] other.log.2.gz.1.3.gz.1.gz 16-May-2013 06:29 20
[ ] other.log.2.gz.1.4.gz 16-May-2013 06:29 33
[ ] other.log.2.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.2.gz.2.gz 18-May-2013 01:46 2.1K
[ ] other.log.3.gz 21-May-2013 06:26 0
[ ] other.log.3.gz.1.gz 20-May-2013 06:26 20
[ ] other.log.3.gz.2.gz 19-May-2013 06:26 14K
[ ] other.log.4.gz 21-May-2013 06:26 0