I'm writing a script to backup some files on a daily basis. The script handles getting rid of old backups automatically, but for ease of monitoring, results go into a single summary log. This log will obviosuly continue to grow over time and I want to be able to shrink the log when it reaches a certain size (let's say 1Mb). I could code this myself, but there must be something out there.....
What I do in my kix scripts when I open the logfile is:
The second paramater determines whether the file is appended to or overwritten. In the case above, it is appended to until it reaches 50k. If it's 50k+, the content gets overwritten.Code:$ = RedirectOutput($logfile, GetFileSize($logfile) > 51200)
It may not be exactly what you want as you lose the previous content, but if you're logging this elsewhere and this is only a summary it may be an option to consider.
There are currently 1 users browsing this thread. (0 members and 1 guests)