ich möchte, dass logrotate die alten Logs z.B. auth nach /var/log/alt/auth rotiert.
meine logrotate.conf sieht wie folgt aus
Code: Alles auswählen
cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
olddir /var/log/alt
# uncomment this if you want your log files compressed
#compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 5
olddir /var/log/alt/wtmp
}
/var/log/btmp {
missingok
monthly
create 0664 root utmp
rotate 5
olddir /var/log/alt/btmp
}
# system-specific logs may be configured here
Code: Alles auswählen
cat /etc/logrotate.d/auth
/var/log/auth.log {
olddir /var/log/alt/auth
rotate 6
monthly
compress
missingok
notifempty
}
Code: Alles auswählen
ll /var/log/ |grep alt;ll /var/log/alt/ |grep auth
drwxr-xr-x 16 root root 4.0K Mar 24 18:34 alt
drwxr-x--- 2 root adm 4.0K Mar 24 18:33 auth
Code: Alles auswählen
ll /var/log/ |grep auth
-rw-r----- 1 root adm 464352 2007-03-24 18:46 auth.log
-rw-r----- 1 root adm 352938 2007-03-18 06:47 auth.log.0
-rw-r----- 1 root adm 25285 2007-03-11 06:47 auth.log.1.gz
-rw-r----- 1 root adm 3443 2007-03-04 06:47 auth.log.2.gz
Twilo