From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: Log rotation
   Date: Mon, 24 Apr 2006 03:23:54 -0400
Msg# 1275
View Complete Thread (2 articles) | All Threads
Last Next
Dylan Penhale wrote:
[posted to rush.general]

Once rushd.log is rotated 0rush.log is overwritten with rush.log, which
means that we have at any one time 2 days of rushd logs.

I'm trying to trace some activity to a job 4 days ago. That data is probably already gone, but I thought I would modifiy the rush log rotation a little, at least on our jobs servers.
Where can I do that? I can't see it in the usual places, all I see is
logrotatehour.

	There's a couple of ways to do this.

	The easiest is to make a crontab entry that grabs a snapshot of the
	Orushd.log an hour or so after midnight, so you can append it to a 'weekly' log:

# EVERY NIGHT, APPEND Orushd.log TO A COMPILATION FOR THE WEEK
0 1 * * * (/bin/date; cd /usr/local/rush/var; cat Orushd.log >> THISWEEK-rushd.log ) >> /var/log/rush-rotate.log 2>&1

# EVERY SUNDAY NIGHT, RENAME THE COMPILATION LOG OUT TO 'LAST WEEK'
10 1 * * 0 (cd /usr/local/rush/var; mv WEEK-rushd.log LASTWEEK-rushd.log ) >> /var/log/rush-rotate.log 2>&1

	If you want, you can do this on a central unix machine, so that you
	can reach out to a particular host (windows, unix) to grab the old log.
	So if the remote machine you want to keep track of is called "tahoe",
	then on your central unix machine you could make a crontab:

# EVERY NIGHT, APPEND Orushd.log FROM HOST 'tahoe' TO A COMPILATION FOR THE WEEK
0 1 * * * (/bin/date; rush -catlog Orushd.log tahoe >> /some/dir/tahoe-THISWEEK.log ) >> /var/log/rush-rotate.log 2>&1

# EVERY SUNDAY NIGHT, RENAME THE COMPILATION LOG OUT TO 'LAST WEEK'
10 1 * * 0 (cd /some/dir; mv WEEK-rushd.log LASTWEEK-rushd.log ) >> /var/log/rush-rotate.log 2>&1

	** OR ** you can disable rush from rotating the logs altogether by setting
	'logrotate -1', and use a crontab to rotate the log every sunday night
	with eg. 'rush -rotate [hostname]'.

	Hope I don't have any typos in the above. But at least those commands should
	give an idea of ways to approach it.

--
Greg Ercolano, erco@(email surpressed)
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)
Cel: (Tel# suppressed)
Fax: (Tel# suppressed)

Last Next