Manages the cleanup of logfiles generated by RPLib.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Number_Of_Days | Integer | Files that are so many days older than the current day will be deleted. | Yes |
| FolderLocation | String | The folder where the logfiles are being stored. | Yes |
Returns: Boolean
Simple call with all parameters specified.Delete files older than 14 days or 2 weeks.import RPLib NumberOfDays = 14 LogFileLoc = "C:/GIS/Logs" RPLib.deletefilesolderthan(NumberOfDays,LogFileLoc)
- Note All files within this directory will be deleted if they are older than the specified date.
Simple call with all parameters specified.Delete files older than 7 days or 1 weeks.All files within this directory will be deleted if they are older than the specified date.Notice that here we are using a UNC pathimport RPLib NumberOfDays = 7 LogFileLoc = "//GIS-SERVER/Scripts/Logs" RPLib.deletefilesolderthan(NumberOfDays,LogFileLoc)
If Else logic with all parameters specified.Delete files older than 21 days or 3 weeks.All files within this directory will be deleted if they are older than the specified date.Notice that here we are using a UNC pathimport RPLib NumberOfDays = 21 LogFileLoc = "//GIS-SERVER/Scripts/Logs" if RPLib.deletefilesolderthan(NumberOfDays,LogFileLoc): print("successful, run another tool") else: print("failed, run another tool")
- Note - This will start the main ArcGIS Server service through the Windows Services Console.