Log filename as specified in log block

These are old archives. They are kept for historic purposes only.
Post Reply
RusselB
Posts: 7
Joined: Thu Nov 09, 2006 12:52 am

Log filename as specified in log block

Post by RusselB »

Is it possible to have the log filename automatically changed, so that I get a different log for each day, (preferably with the filename of the log containing the date for that log).

Eg: Ircd-07-01-2007.log would be the log for July 1st 2007.

If this is possible, I would appreciate direction on how to do so.
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Log filename as specified in log block

Post by Stealth »

If you're running Unreal on *nix, make a cron job and a small script to rename the file to what you please... If you're on WIndows, I don't know how I would go about doing that.
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Log filename as specified in log block

Post by Stealth »

A quick bit of research, and here is a nice cron line I just made:

Code: Select all

59 23 * * * mv /path/to/ircd.log /path/to/ircd.$(date +%Y%m%d).log
This will rename your logfile at 11:59pm each night to include that days date.
RusselB
Posts: 7
Joined: Thu Nov 09, 2006 12:52 am

Re: Log filename as specified in log block

Post by RusselB »

Thanks for the fast reply, Stealth.

We are running on *nix

Regretfully I'm still learning about this, so I'll pass your suggestion on to the person that is teaching me, as I don't have a clue as to where that would go.
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Log filename as specified in log block

Post by Stealth »

Code: Select all

crontab -e
That will allow you to edit the crontab for your user (usually in vi). Just drop the line in there, save, and watch it work :D
Post Reply