0

I want to rotate the whole /var/log folder on my server every day so I have the /var/log folder and compressed files like "log.1.gz" which contains the whole directory.

I can't found anything on the man page which can do that.

1 Answers1

2

That is not a good idea. Big part of the log rotation process is forcing applications to change the log file they are using. You to do that for a directory, you need to manage this for all the logs in it.

melsayed
  • 1,122
  • 1
  • 6
  • 12
  • But can't I use logrotate for this? –  Jul 08 '14 at 13:46
  • 1
    Back to the drawing board, @EliasEx. You seem to be reinventing the wheel without a good reason -- or at least you did not tell us *why* you want to do something like this. All kinds of log rotation scripts shipped with Linux/whatever distros are already fine-tuned with much love, joy, hate and tears. Reinventing all that does not sound like wise. So. Why? – Janne Pikkarainen Jul 08 '14 at 13:59
  • I have a lot of non-distro programs so they do not rotate their logs. I want to have ONE files so I can take it and have all log entries for one day which I can read to find out problems or sth like this. –  Jul 08 '14 at 14:16
  • You can create a logrotate configuration for multiple files. Check the docs. – melsayed Jul 08 '14 at 14:19
  • Yes! But I wanted to ask how I am able to define this for all files in /var/log with one block... –  Jul 08 '14 at 14:21