Former-commit-id:8da36046de
[formerlyc8aae98741
] [formerly54be9660f1
[formerly 60f30af0c9e3203e2ff623d420165201dff41601]] Former-commit-id:54be9660f1
Former-commit-id:4450cf8963
18 lines
666 B
Python
18 lines
666 B
Python
|
|
import os, shutil, time
|
|
from com.raytheon.edex.plugin.gfe.config import IFPServerConfigManager
|
|
import siteConfig
|
|
import LogStream
|
|
|
|
def main():
|
|
path = siteConfig.GFESUITE_LOGDIR+"/"
|
|
if(os.path.exists(path)):
|
|
purgeAge = IFPServerConfigManager.getServerConfig(siteConfig.GFESUITE_SITEID).logFilePurgeAfter()
|
|
duration = 86400 * purgeAge
|
|
cutoffTime = time.strftime("%Y%m%d", time.gmtime(time.time() - duration))
|
|
LogStream.logEvent("Purging GFE log files older than", purgeAge, "days")
|
|
dirList = os.listdir(path)
|
|
|
|
for fname in dirList:
|
|
if fname < cutoffTime:
|
|
shutil.rmtree(path + fname)
|