Process Monitor logs may be required to troubleshoot a backup issue. The issue may reproduce under various conditions and is sometimes random, preventing successful manual log collection.
This article provides a set of simple Windows batch scripts that can be used to initiate Process Monitor log collection as part of a scheduled backup plan without user interaction.
Process Monitor logs collection is a resource-heavy procedure. Make sure to set up the log collection carefully as incorrect usage may result in the overuse of local resources, especially disk space, resulting in potential system malfunction.
Unattended log collection assumes logs are being saved directly to files, which increases disk I/O load. To prevent potential backup/snapshot failures, we recommend saving logs to disks that are not actively utilized otherwise.
File | Purpose |
---|---|
run_procmon.bat | Main script that initiates log collection and sets up initial duration and timeout. Script accepts three parameters 1: duration value in seconds, if not specified the procmon log collection will have to be stopped manually |
stop_procmon.bat | Script that simply stops any procmon log collection. Takes no parameters |
stop_procmon_after.bat | Script that stops any procmon log collection after a timeout. Takes one parameter - timeout value in seconds. If not specified the script will do nothing |
stop_and_clear.bat | Script that stops any procmon log collection and cleans up logs collected from specified folder. Takes one parameter - target folder. If not specified logs will be deleted from the same folder where script is placed |
del_procmon.bat | Script that deletes collected procmon logs. Takes one parameter - target folder. If not specified logs will be deleted from the same folder where script is placed |
You can modify the scripts to your liking, but remember - Windows batch script creation is out of Acronis support scope. Scripts in this article are provided as an example, any issues with modified scripts need to be analyzed by the author of the modification.
Command or batch file | run_procmon |
Working directory | D:\Procmon |
Arguments | 300 D:\Procmon\Logs |
Fail the backup | unchecked |
Do not back up until completes | unchecked |
To stop procmon and clear logs as soon as the backup is finished enable "Command after backup".
Procmon will stop immediately and logs will be deleted from "D:\Procmon\Logs" if the backup is successfully finished.
This command will not trigger if the backup fails
Command or batch file | stop_and_clear |
Working directory | D:\Procmon |
Arguments | D:\Procmon\Logs |
Fail the backup | unchecked |
In the Backup options navigate to "Pre-post data capture commands"
Specify the following parameters
To stop running procmon logs collection 5 minutes after snapshot starts enable "Command before data capture"
This command will trigger a 5-minute timeout and will terminate any running procmon afterward
Command or batch file | stop_procmon_after |
Working directory | D:\Procmon |
Arguments | 300 |
Fail the backup | unchecked |
Do not back up until completes | unchecked |
To stop running procmon immediately after snapshot finishes enable "Command after data capture"
Command or batch file | stop_procmon |
Working directory | D:\Procmon |
Arguments | |
Fail the backup | unchecked |
Do not back up until completes | unchecked |
After making the changes click Done and save changes in the backup plan. The next scheduled backup plan will generate logs according to the options used.