How To rotate syslog daily?

29,464

Solution 1

You can change settings in /etc/logrotate.d/rsyslog but for me it's daily by default.

Solution 2

On my system, I found /etc/logrotate.d/rsyslog.disabled instead of /etc/logrotate.d/rsyslog. After renaming it to /etc/logrotate.d/rsyslog, things are working fine.

Share:
29,464

Related videos on Youtube

Frank Moore
Author by

Frank Moore

Updated on September 18, 2022

Comments

  • Frank Moore
    Frank Moore over 1 year

    I want to rotate my syslog daily... How do I do this? How to check whether log rotate is working? How to make it run daily? By default, does Ubuntu Server run logrotate daily? Or do I have to set it after installation?

    • mikewhatever
      mikewhatever about 12 years
      You can check with ls /etc/cron.daily/ | grep logrotate.
    • Frank Moore
      Frank Moore about 12 years
      @mikewhatever In the result it says logrotate ... So that means its working right? But how to rotate syslog daily? Is it on by default? If its on... Its not working for me!
    • mikewhatever
      mikewhatever about 12 years
      Yes, that means the logrotate job is run daily. Why do you think it's not working?
    • Frank Moore
      Frank Moore about 12 years
      @mikewhatever The syslog is not rotated!
    • mikewhatever
      mikewhatever about 12 years
      Are you saying the syslog in never rotated? That sounds unlikely, can you post some evidence.
    • Frank Moore
      Frank Moore about 12 years
      Please tell me what evidence you want... In the log directory, I have one big syslog file which have records since I started the server last month!
    • mikewhatever
      mikewhatever about 12 years
      If that's the case, it might be a bug. File a bug report with detailed explanations, as well as the size of the syslog file.