štvrtok 29. októbra 2020

Managing log rotation in Linux

 Add new file to rotation:

  • copy one of /etc/logrotate.d/* configuration files to working (e.g. home) directory, name it e.g. new-file
  • vim new-file
    • change path to point to new (existing) file to be rotated
    • change other parameters, if needed
  • sudo mv new-file /etc/logrotate.d/
  • sudo chown root:root /etc/logrotate.d/new-file
Dry run:

logrotate -d /etc/logrotate.d/new-file

Forced rotation:

sudo logrotate -vf /etc/logrotate.d/new-file

More info:

Žiadne komentáre:

Zverejnenie komentára