Logrotate does not auto rotate when based on log size -


i have custom application (myapp) writing logs file '/var/log/myapp'. can see logs being written , works fine. trying setup logrotate file , have created config file '/etc/logrotate.d/myapp', contents of -

/var/log/myapp {    missingok    size +10k    start 0    nocompress    create 0600 root root    rotate 10    postrotate      /etc/init.d/rsyslog restart > /dev/null 2>&1 || true    endscript } 

now if logrotate -dv /etc/logrotate.d/myapp don't see errors such , when logrotate -f /etc/logrotate.d/myapp executed i.e., forceful logrotate log rotated. when log file size exceeds 10k log not automatically rotated. appreciated.

logrotate rotates logs specified in /etc/logrotate.d/ according time interval configured in /etc/logrotate.conf. on distros, default value week. can override time interval in specific config using e.g. 'daily' in config file.

log files not rotated until logrotate has known files @ least long time specified. assume waited long and/or modified conf file?


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -