Skip to content
English
  • There are no suggestions because the search field is empty.

Automatically Deleting Older Log Files

Search

Automatically Deleting Older Log Files

Schedule this command to run nightly in Task Manager to delete log files older than 30 days.

Open PowerShell and type Set-ExecutionPolicy Unrestricted > enter "y" & enter when prompted   Download the "DeleteLogs.ps1" file in this ticket to the target server and save the file to C:\ Create a new scheduled task, run as root, run whether user is logged in or not Trigger is 1st of every month, any time is fine Action is run a program, Powershell.exe, arguments are c:\DeleteLogs.ps1     Save it, and run it manually. Then check your logs folder and make sure they were deleted.  To run manually: navigate to the file in file explorer right click > select run in PowerShell Check c:\clubspeed\cs_replication\logs that the only files are 10 days or younger. ps1 (137 Bytes)

Related Articles