The process can be broken down into these few steps:
- A scheduled task to run a script
- The script zips up the log files and saves to an archive folder
Below are the scripts to get the job done.
I added the Compress-Archive script here:
/sitecore/system/Modules/PowerShell/Script Library/Functions/Compress-Archive
I then added the Archive Logs script here: /sitecore/system/Modules/PowerShell/Script Library/Tasks/Archive Logs
Finally, I created the scheduled task using the PowerShellScriptCommand.
You'll notice here that I'm using a custom field for the Task Scheduler so it's easier to see what's configured.
These scripts should be included in a future build of Sitecore PowerShell Extensions but feel free to start using now!
I then added the Archive Logs script here: /sitecore/system/Modules/PowerShell/Script Library/Tasks/Archive Logs
Finally, I created the scheduled task using the PowerShellScriptCommand.
These scripts should be included in a future build of Sitecore PowerShell Extensions but feel free to start using now!