1
I can't manage to work this dummy config file (I placed it in etc/logrotate.d):
/var/log/test_log/mylogfile {
copytruncate
dateext
rotate 3
compress
missingok
size=+2
}
I write to the log (echo "hello world" > /var/log/test_log/mylogfile) but it's just not working.
Doing cat /etc/crontab shows:
# check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly
#
-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
I later redirected the output to in this way:
-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons > /var/log/test_log/log_logrotate
But nothing happened.
Should I add another line in the etc/crontab to force the cron.dayly to happen kind of like in Ubuntu:
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
or the problem may be in the /usr/lib/cron/run-crons file??
I am under SUSE Linux Enterprise Server 11 SP2
how often you want to rotate ? – Darek – 2015-02-12T13:48:18.847
@tdi I would like to do it dayly but my example is just a dummy example. I can't run any logrotate file. Anyway the size option should trigger the logrotate, shouldn't it? – gugol – 2015-02-12T15:00:45.453
see my answer below. – Darek – 2015-02-12T15:06:55.943