- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Need to create a automated script in (Windows 2019 Servers) to clear the Log/temp files in the Midtier.
We have 1meat, 1mid and 2 compute Servers.
Right now we are doing it on manually, Need to automate to clear the files.
\Config\Lev1\Web\WebAppServer\SASServer1_1\logs
\Config\Lev1\Web\WebAppServer\SASServer1_1\temp
\Config\Lev1\Web\WebServer\logs
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You need to be aware of not accidentally deleting "live logs". For this reason, I only run log "Cleanup" scripts when I take all SAS services down for monthly maintenance. I do schedule a cleanup on logs that are not live like batch logs and have some logic to delete files based on last modified date. I have attached some script snippets to hopefully give you some inspiration. I tend to wrap PowerShell scrips inside .cmd commands...but YMMV as there are so many ways to do things.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Looks like there is a logrotate like utility available on windows. The details are available at GitHub - plecos/logrotatewin: This is a Windows implementation of the logrotate utility found in Lin...
On Unix/Linux this is used routinely to archive and then remove old logs.
However, for windows recommend testing and due diligence before using it.
In case you adopt it please share your experiences for the benefit of other users.