Page 1 of 1

Deleting log-files older than < x > days with TI

Posted: Mon Feb 07, 2011 8:13 pm
by Marcus Scherer
At the costumer site no admin ever observed and probably never will observe the log-files. Thus they can be regularly deleted, assuming a regular backup of the log directory on tape is in place! Maybe you're interested in it.

- valid for the actual decade (searching for "tm1s201*.log")
- Windows OS

Re: Deleting log-files older than < x > days with TI

Posted: Mon Feb 07, 2011 10:45 pm
by Mike Cowie
Marcus:

Thanks for posting this. There are also some DOS-based ways of doing this, too, if you'd like to use some other non-TI scheduler, or would like to use a single batch file/command from TI (using ExecuteCommand). One of the DOS command methods I've used takes advantage of the Forfiles command and looks something like this (this one clears out Cognos Express logs 21 days or older):

Code: Select all

cmd /c Forfiles -p "C:\Program Files (x86)\IBM\Cognos Express\logs\express" -s -m "*.log" -d "-21" -c "cmd /c del /q @path"
A bit cryptic at first glance, but 1 command takes care of it all.

Some notes on the ForFiles command, if interested in learning more about it:
http://technet.microsoft.com/en-us/libr ... S.10).aspx

Regards,
Mike

Re: Deleting log-files older than < x > days with TI

Posted: Thu Mar 31, 2011 2:08 am
by BigG
Hi there, just jumping in on this post, if you run that cmd arethere any .log files that are located in C:\Program Files (x86)\IBM\Cognos Express\logs\express that you would want to consider retaining?

Note we are on cognos express too

Re: Deleting log-files older than < x > days with TI

Posted: Thu Jan 05, 2012 3:01 pm
by ADW
This question has just popped up for us.

We want to delete older log files but are not sure which ones we need to keep hold of.

Also have Cognos Express.

Re: Deleting log-files older than < x > days with TI

Posted: Thu Jan 05, 2012 10:19 pm
by BigG
Hi ADW, we ended up just going for every .log file 3 weeks or older deleted once a week using the script from Marcus. Also restart service at same time

Re: Deleting log-files older than < x > days with TI

Posted: Fri Jan 06, 2012 8:25 am
by ADW
Thanks for that.

I was worried that deleting the cogserver.log file would cause a problem, but I guess that file never gets older than the last time Cognos was used.