1. Diese Seite verwendet Cookies. Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies. Weitere Informationen

Logrotate problem

Dieses Thema im Forum "Archiv" wurde erstellt von Beastmaster, 10. Oktober 2010.

  1. Beastmaster
    Offline

    Beastmaster Moderator Digital Eliteboard Team

    Registriert:
    9. Oktober 2008
    Beiträge:
    3.617
    Zustimmungen:
    12.203
    Punkte für Erfolge:
    113
    Ordner tmpfs /var/log leuft nach 1-2 tage voll
    obwohl es stündlich gelöscht werden soll

    Code:
    root@debian ~ > /etc/cron.hourly/logrotate
    error: /etc/logrotate.conf:3 unknown option 'hourly' -- ignoring line
    

    Crontab


    Code:
    # m h dom mon dow user	command
    17 *	* * *	root          cd / && run-parts --report /etc/cron.hourly 
    25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
    47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
    52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
    

    /etc/logrotate.conf:

    Code:
    # see "man logrotate" for details
    # rotate log files weekly
    hourly
    
    # keep 4 weeks worth of backlogs
    rotate 4
    
    # create new (empty) log files after rotating old ones
    create
    
    # 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 1
    }
    
    /var/log/btmp {
        missingok
        monthly
        create 0660 root utmp
        rotate 1
    }
    
    # system-specific logs may be configured here


    /etc/logrotae.d/rsyslog:

    Code:
    /var/log/syslog
    /var/log/daemon.log
    {
    	rotate 1
           daily
    	size 3M
    	missingok
    	notifempty
    	delaycompress
    	compress
    	postrotate
    		invoke-rc.d rsyslog reload > /dev/null
    	endscript
    }
    
    /var/log/mail.info
    /var/log/mail.warn
    /var/log/mail.err
    /var/log/mail.log
    /var/log/kern.log
    /var/log/auth.log
    /var/log/user.log
    /var/log/lpr.log
    /var/log/cron.log
    /var/log/debug
    /var/log/messages
    {
    	rotate 1
           daily
    	size 1M
    	missingok
    	notifempty
    	compress
    	delaycompress
    	sharedscripts
    	postrotate
    		invoke-rc.d rsyslog reload > /dev/null
    	endscript
    }
    
    /var/log/ipc/CCcam-iusers.log
    /var/log/ipc/CCcam-bcommands.log
    /var/log/ipc/CCcam-restart-*.log
    {
    	rotate 1
           daily
    	size 1M
    	missingok
    	notifempty
    	delaycompress
    	compress
    	postrotate
    		invoke-rc.d rsyslog reload > /dev/null
    	endscript
    }
    

    Manuell anstoß des Logrotates:

    Code:
    root@debian ~ > logrotate -d /etc/logrotate.conf
    reading config file /etc/logrotate.conf
    error: /etc/logrotate.conf:3 unknown option 'hourly' -- ignoring line
    including /etc/logrotate.d
    reading config file apache2
    reading config info for /var/log/apache2/*.log
    reading config file apt
    reading config info for /var/log/apt/term.log
    reading config file aptitude
    reading config info for /var/log/aptitude
    reading config file dpkg
    reading config info for /var/log/dpkg.log
    reading config file fail2ban
    reading config info for /var/log/fail2ban.log
    reading config file rsyslog
    reading config info for /var/log/syslog
    /var/log/daemon.log
    
    reading config info for /var/log/mail.info
    /var/log/mail.warn
    /var/log/mail.err
    /var/log/mail.log
    /var/log/kern.log
    /var/log/auth.log
    /var/log/user.log
    /var/log/lpr.log
    /var/log/cron.log
    /var/log/debug
    /var/log/messages
    
    reading config info for /var/log/ipc/CCcam-iusers.log
    /var/log/ipc/CCcam-bcommands.log
    /var/log/ipc/CCcam-restart-*.log
    
    reading config info for /var/log/wtmp
    reading config info for /var/log/btmp
    
    Handling 10 logs
    
    rotating pattern: /var/log/apache2/*.log  weekly (52 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/apache2/access.log
      log does not need rotating
    considering log /var/log/apache2/error.log
      log does not need rotating
    considering log /var/log/apache2/other_vhosts_access.log
      log does not need rotating
    not running shared postrotate script, since no logs were rotated
    
    rotating pattern: /var/log/apt/term.log  monthly (6 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/apt/term.log
      log does not need rotating
    
    rotating pattern: /var/log/aptitude  monthly (6 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/aptitude
      log does not need rotating
    
    rotating pattern: /var/log/dpkg.log  monthly (12 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/dpkg.log
      log does not need rotating
    
    rotating pattern: /var/log/fail2ban.log  weekly (4 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/fail2ban.log
      log does not need rotating
    
    rotating pattern: /var/log/syslog
    /var/log/daemon.log
     3145728 bytes (1 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/syslog
      log does not need rotating
    considering log /var/log/daemon.log
      log does not need rotating
    
    rotating pattern: /var/log/mail.info
    /var/log/mail.warn
    /var/log/mail.err
    /var/log/mail.log
    /var/log/kern.log
    /var/log/auth.log
    /var/log/user.log
    /var/log/lpr.log
    /var/log/cron.log
    /var/log/debug
    /var/log/messages
     1048576 bytes (1 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/mail.info
      log does not need rotating
    considering log /var/log/mail.warn
      log does not need rotating
    considering log /var/log/mail.err
      log does not need rotating
    considering log /var/log/mail.log
      log does not need rotating
    considering log /var/log/kern.log
      log does not need rotating
    considering log /var/log/auth.log
      log does not need rotating
    considering log /var/log/user.log
      log does not need rotating
    considering log /var/log/lpr.log
      log does not need rotating
    considering log /var/log/cron.log
      log /var/log/cron.log does not exist -- skipping
    considering log /var/log/debug
      log does not need rotating
    considering log /var/log/messages
      log does not need rotating
    not running shared postrotate script, since no logs were rotated
    
    rotating pattern: /var/log/ipc/CCcam-iusers.log
    /var/log/ipc/CCcam-bcommands.log
    /var/log/ipc/CCcam-restart-*.log
     1048576 bytes (1 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/ipc/CCcam-iusers.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-bcommands.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100914_2118.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100914_2141.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100914_2151.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100915_0002.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100915_1858.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100915_1921.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100915_1933.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100915_2252.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100915_2305.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100916_1602.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100916_1606.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100918_0200.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100918_0204.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100919_2058.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100923_2110.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100923_2130.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100923_2147.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100923_2211.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20100923_2221.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101005_2221.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_0159.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_0211.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_0222.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_0257.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_0349.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_0406.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_0426.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_0456.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_0504.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_1515.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_1521.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_1523.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_1556.log
      log does not need rotating
    considering log /var/log/ipc/CCcam-restart-20101008_1614.log
      log does not need rotating
    
    rotating pattern: /var/log/wtmp  monthly (1 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/wtmp
      log does not need rotating
    
    rotating pattern: /var/log/btmp  monthly (1 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/btmp
      log does not need rotating
    
    Bild von Inhalt /etc/cron.daily:
    Bild von Inhalt /etc/cron.hourly:
     
    Zuletzt bearbeitet: 10. Oktober 2010
    #1

Diese Seite empfehlen