Do you have a simple script for rotating logs?

Most folks roll their own so that it works well with the other log rotation schemes they have going on their systems.

I like to use a script something like:

			del <snflic>.log.9
			rename <snflic>.log.8 <snflic>.log.9
			rename <snflic>.log.7 <snflic>.log.8
			rename <snflic>.log.6 <snflic>.log.7
			rename <snflic>.log.5 <snflic>.log.6
			rename <snflic>.log.4 <snflic>.log.5
			rename <snflic>.log.3 <snflic>.log.4
			rename <snflic>.log.2 <snflic>.log.3
			rename <snflic>.log.1 <snflic>.log.2
			rename <snflic>.log <snflic>.log.1
		    

where  <snflic>  is your license id.

Set it up as a daily scheduled task and that's usually all there is to it.

If the logs are being reported then adding that bit to this script or this script to that will usually work fine.

Note that Version 3 has a rotate feature that (optionally) puts a date stamp into the log file name to rotate the log files. Log file names are then something like <snflic>.YYYYMMDD.log.xml. The rotate feature does not delete older log files so you will probably want to have a scheduled task set up to do that.

snflicid.20080520.log
snflicid.20080520.log.xml

To turn on rotation in the configuration file set rotate='yes' as in:

<classic mode='file' rotate='yes' matches='unique'/>

or

<xml mode='file' rotate='yes' matches='all' performance='yes' gbudb='yes'/>
Related Topics