2

I'm removing the delaycompress function from my logrotating script. Before running logrotate again, should I compress the last log myself ?

This is the actual situation:

-rw-r-----  1 root adm  4,7M  5 mag 18:38 access.log
-rw-r-----  1 root adm  5,2M 29 apr 05:44 access.log.1
-rw-r-----  1 root adm  473K 22 apr 05:45 access.log.2.gz
-rw-r-----  1 root adm  605K 15 apr 05:44 access.log.3.gz
-rw-r-----  1 root adm  588K  8 apr 05:44 access.log.4.gz

The question is: Should I compress "access.log.1" and THEN launch logrotate ?

Or logrotate will understand I removed the "delaycompress" option and fix things himself ?

ELAN42
  • 21
  • 1

1 Answers1

0

From my quick tests, you'll need to compress the file yourself. However, you find can exactly what it'll do by running it in debug mode:

logrotate --debug --force /etc/logrotate.d/apache2

Obviously, change the path to the location of your config file :)

Kirrus
  • 482
  • 2
  • 11
  • You're very welcome, @user120006. Though, if you liked my reply, and found it useful, please click the green tick on it, to mark it as 'solving' your problem, and if you want upvote to give me more reputation! Hope you're enjoying StackOverflow :) – Kirrus May 01 '18 at 19:32