Automating Log File Management
Created: 2012-04-20 08:09:59Modified: 2024-02-15 09:50:31
Tags: System Requirements Troubleshooting UnitySync
You may schedule log file cleanup in your automated sync batch. The primary shell.exe program includes an option to clean-up old log files. By adding --cleanlogs
to your automated batch script, your automated process will keep your logs in check by deleting all but the desired most recent logs.
Command Line cleanup
Execute the following command:
shell --cleanlogs
By default, cleanLogs runs against ALL connections and 30 days worth of logs will be saved. The rest will be deleted.
Optional –days parameter:
shell --cleanlogs [--days x]
Default is to keep 30 days worth of logs. You may use the --days
parameter to increase or decrease the number of days worth of logs to keep.
Connection Name
shell --cleanlogs --conn [Connection Name]
Note: For versions prior to v4.6:
Syntax for versions prior to v4.6 should omit --conn
i.e. shell.exe “Paris-to-Master”
By default if you do not specify a connection name, cleanlogs will clean all connections logs. Specify a connection name to run clean logs against an individual connection.
Scheduling
You may add the shell --cleanlogs
command to your automated script to regularly run and keep the number of log files limited as desired.
Additional command line cleanup examples:
Delete logs from one specific Connection within a FOLDER:
shell --cleanlogs --days 60 --conn "folderX\YourConnectionNameY"
Delete logs from ALL Connections within a FOLDER:
for /D %%D in (..\connections\FolderA\*.) DO ..\Programs\shell.exe --cleanlogs --days 60 --conn "%%D"
To Delete Log Files Manually:
Logs may be deleted manually from File Explorer. Log files are located in:
...\UnitySync\connections\YourConnectionName\log