Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My Cron job is not running and i want to see what's problem in the syslog.

But that log is only showing current date only ,

Is there any way to keep logs for the last 10 days?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The logs are most likely being rotated by the logrotate process. Look in /etc/logrotate.conf. You should see something like this:

daily

rotate 1

Change that to:

daily

rotate 10

You could also do something like this to keep 4 weeks of logs:

weekly

rotate 4
share|improve this answer
    
i want to keep logs in one file only like in syslog for 1 month. how can i do that –  John Apr 29 '10 at 0:58
    
Keeping more then a couple of days in a single file is a really bad idea for any server out on the internet, as there's a bunch of things that people can do to cause your server to log junk. Having logrotate keep logs longer is ok. man logrotate should help. –  LapTop006 Apr 29 '10 at 14:22

Yesterdays log is /var/log/syslog.1. They are rotated daily about 6 in the morning. Previous days logs are syslog.2.gz... Use zless or zgrep to look at the compressed logs.

Data is likely in /var/log/messages as well. This is rotated weekly, and has four weeks of old logs.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.