LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-25-2009, 08:46 AM   #1
MeeLee
Member
 
Registered: Aug 2009
Posts: 48

Rep: Reputation: 3
RHEL 5.* logfiles


How do you check what time the logfiles run?

I can see in:

/etc/logrotate.conf

that they are daily, and in:

/etc/logrotate.d

who is being rotated...

but is there a way to tell what time they will run? Is it just a default of midnight? How can you tell?

How would I go about setting them so that the rotated at, say 3am in the morning?

Many Thanks in advance,

Lee
 
Old 08-25-2009, 08:54 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
You can see the time at which the logrotate script is executed by looking at /etc/crontab. For example on my RHEL4 system I have:
Code:
$ cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
As you can see the daily job is executed at 4:02 AM. This is confirmed by the cron log:
Code:
$ grep daily /var/log/cron
Aug 24 04:02:01 server crond[23584]: (root) CMD (run-parts /etc/cron.daily)
Aug 24 04:02:04 server anacron[23991]: Updated timestamp for job `cron.daily' to 2009-08-24
Aug 25 04:02:01 server crond[25136]: (root) CMD (run-parts /etc/cron.daily)
Aug 25 04:02:04 server anacron[25563]: Updated timestamp for job `cron.daily' to 2009-08-25
You can change the time in /etc/crontab if you have root privileges.
 
Old 08-25-2009, 08:58 AM   #3
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
You can see what time they run by looking at the contents of the following file:

/etc/crontab

For example you could run the following command:

Code:
[root@fs2 etc]# cat crontab 
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
Usually the logrotate script is run with the 'cron.daily'

Regards,

Fordeck
 
Old 08-25-2009, 10:15 AM   #4
MeeLee
Member
 
Registered: Aug 2009
Posts: 48

Original Poster
Rep: Reputation: 3
Thank you both!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
logcheck does not read logfiles! cyberpunx Linux - Software 16 04-06-2015 03:18 AM
mysql logfiles cccc Debian 1 02-24-2009 09:00 AM
finding program logfiles atom Linux - Software 3 08-10-2004 05:33 PM
how to monitor logfiles ganninu Linux - General 4 12-07-2003 07:36 AM
Logfiles wonderpun Linux - General 3 09-01-2002 04:27 AM


All times are GMT -5. The time now is 10:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration