We provided him with a solution that automatically backed up the log files when the server started up.
- Open CompleteFTP Manager
- Select the Events panel
- Click Add
- Enter Back up logs in the Name field
- Click Choose
- Select Server start
- Select Powershell script
- Copy the script at the end of this comment into the Script field
- Click Apply changes
Script:
# Backs up all Diagnostics.log files in a timestamped zip file
$today = Get-Date -Format "yyyy-MM-dd"
$logFolder = "C:\ProgramData\Enterprise Distributed Technologies\Complete FTP\Logs\"
$backupFolder = "$logFolder\Backup-$today"
$zipPath = "$logFolder\Backup-$today.zip"
# Delete backup folder if it exists
If (test-path $backupFolder)
{
Remove-Item -Path $backupFolder -Force -Recurse
}
# Create a new backup folder
New-Item -ItemType Directory -Force -Path $backupFolder
# Remove zip file if it exists
If (test-path $zipPath)
{
Remove-Item -Path $zipPath -Force
}
# Copy Diagnostic log files into backup folder (since we can't zip coz of file-lock)
Copy-Item -Path "$($logFolder)\Diagnostics.*" -Destination $backupFolder
# Create the zip
Compress-Archive -Path $backupFolder -DestinationPath $zipPath
# Delete the backup folder
Remove-Item -Path $backupFolder -Force -Recurse