6

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?

THpubs
  • 2,775
  • 10
  • 42
  • 55
  • 1
    You can check with `ls /etc/cron.daily/ | grep logrotate`. – mikewhatever Apr 25 '12 at 05:01
  • @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! – THpubs Apr 25 '12 at 05:13
  • Yes, that means the logrotate job is run daily. Why do you think it's not working? – mikewhatever Apr 25 '12 at 05:42
  • @mikewhatever The syslog is not rotated! – THpubs Apr 25 '12 at 05:52
  • Are you saying the syslog in never rotated? That sounds unlikely, can you post some evidence. – mikewhatever Apr 25 '12 at 06:20
  • 1
    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! – THpubs Apr 25 '12 at 06:23
  • 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. – mikewhatever Apr 25 '12 at 06:30
  • @mikewhatever Thanks my friend... One more thing... Does logrotate rotate the log only if it reach a certain size? What will be that limit? – THpubs Apr 25 '12 at 06:38

2 Answers2

9

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

int_ua
  • 8,394
  • 12
  • 78
  • 144
3

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.

Jeff
  • 1,614
  • 17
  • 24