<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need to create a automated script to clear the Log/temp files in the Midtier for windows Server in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/815889#M24467</link>
    <description>I do not have such a script for Windows but I did write something similar for Linux that would essentially delete any files older than a set number of days in given folders, or in the case of midtier logs that don't roll by date (server.log or the web app logs) remove the lines prior to the date of the set number of days prior. I'm sure it would be possible to write such a script in PowerShell for Windows, but this is not a function of SAS.</description>
    <pubDate>Tue, 31 May 2022 16:12:26 GMT</pubDate>
    <dc:creator>gwootton</dc:creator>
    <dc:date>2022-05-31T16:12:26Z</dc:date>
    <item>
      <title>Need to create a automated script to clear the Log/temp files in the Midtier for windows Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/815648#M24461</link>
      <description>&lt;P&gt;Need to create a automated script in (Windows 2019 Servers) to clear the Log/temp files in the Midtier.&lt;/P&gt;
&lt;P&gt;We have 1meat, 1mid and 2 compute Servers.&lt;/P&gt;
&lt;P&gt;Right now we are doing it on manually, Need to automate to clear the files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;\Config\Lev1\Web\WebAppServer\SASServer1_1\logs&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;\Config\Lev1\Web\WebAppServer\SASServer1_1\temp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;\Config\Lev1\Web\WebServer\logs&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 07:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/815648#M24461</guid>
      <dc:creator>siddhu1</dc:creator>
      <dc:date>2022-05-30T07:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create a automated script to clear the Log/temp files in the Midtier for windows Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/815889#M24467</link>
      <description>I do not have such a script for Windows but I did write something similar for Linux that would essentially delete any files older than a set number of days in given folders, or in the case of midtier logs that don't roll by date (server.log or the web app logs) remove the lines prior to the date of the set number of days prior. I'm sure it would be possible to write such a script in PowerShell for Windows, but this is not a function of SAS.</description>
      <pubDate>Tue, 31 May 2022 16:12:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/815889#M24467</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2022-05-31T16:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create a automated script to clear the Log/temp files in the Midtier for windows Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/815910#M24468</link>
      <description>&lt;P&gt;You need to be aware of not accidentally deleting "live logs".&amp;nbsp; For this reason, I only run log "Cleanup" scripts when I take all SAS services down for monthly maintenance.&amp;nbsp; 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.&amp;nbsp; I have attached some script snippets to hopefully give you some inspiration.&amp;nbsp; I tend to wrap PowerShell scrips inside .cmd commands...but YMMV as there are so many ways to do things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Task.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71911iD781CF05C4778A09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Task.PNG" alt="Task.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 16:57:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/815910#M24468</guid>
      <dc:creator>angian</dc:creator>
      <dc:date>2022-05-31T16:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create a automated script to clear the Log/temp files in the Midtier for windows Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/815911#M24469</link>
      <description>I accidentally replied to gwootton....please see that reply....</description>
      <pubDate>Tue, 31 May 2022 17:00:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/815911#M24469</guid>
      <dc:creator>angian</dc:creator>
      <dc:date>2022-05-31T17:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create a automated script to clear the Log/temp files in the Midtier for windows Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/816105#M24483</link>
      <description>&lt;P&gt;Looks like there is a logrotate&amp;nbsp; like utility available on windows. The details are available at&amp;nbsp;&lt;A href="https://github.com/plecos/logrotatewin" target="_blank"&gt;GitHub - plecos/logrotatewin: This is a Windows implementation of the logrotate utility found in Linux platforms. The goal is to use the same command line parameters and files as the Linux version.&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;On Unix/Linux this is used routinely to archive and then remove old logs.&lt;BR /&gt;However, for windows recommend testing and due diligence before using it.&lt;BR /&gt;In case you adopt it please share your experiences for the benefit of other users.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 20:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Need-to-create-a-automated-script-to-clear-the-Log-temp-files-in/m-p/816105#M24483</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2022-06-01T20:03:59Z</dc:date>
    </item>
  </channel>
</rss>

