A File and Folder backup gives the error "File is locked by another process: ___" which lists the file triggering the error. This error prevents the file from getting backed up if retries are unsuccessful and the error may repeat.
When the Backup Agent backs up a file, it needs to access that file, exclusively, for the duration of the time it spends backing it up. Usually this does not present an issue as the software will first ask Microsoft's VSS provider to create a shadow copy of the volumes on which backed-up files reside; when this is done, the software can work off the file in the shadow copy rather than the "live" file itself.
With this in mind, the only time you should get "File is locked by another process" errors is when the shadow copy cannot or did not get made. Situations in which the files cannot be snapshot are as follows:
- Shared Files - If you are attempting to back up files which reside on a machine or device other than the one the Backup Agent is installed on, those files cannot be shadow copied. This stems from the fact the software cannot communicate with the VSS provider on those machines, if they even have one.
- Files Excluded by the VSS Provider - If Microsoft's VSS provider chooses not to include a file or folder in its shadow copy, the backup software should not attempt to back that file or folder up. Usually, this manifests as the "File cannot backup as it cannot be included in snapshots of volume" error.
When VSS Snapshot Creation Fails
If you are getting these errors because VSS was unable to create a shadow copy/snapshot of the volumes containing backed-up files, you will need to fix that issue in order to resolve these errors. Sometimes the Backup Agent will provide a secondary error to the one telling you the VSS snapshot creation failed; you can use this to help you troubleshoot the VSS issue, however, you may want to check the Event Viewer Application and System logs for VSS and volsnap errors. Those events will usually point you in the right direction.
When the Software Does Not Attempt to Create a VSS Snapshot
If you do not see the snapshot creation failing or you see the snapshot step being skipped it may be either because the software cannot create a snapshot (for the reason mentioned above) or because the backup set does not have Snapshot Mode enabled. To change the Snapshot Mode setting, edit the File and Folder backup set and skip to the "Settings" page.
When Files Cannot Be Snapshot
In the event the files you are trying to back up cannot be snapshot at all, the only recourse you may have is to schedule the backups to run at the least-busiest time of day or, if the other device hosting the files is a Windows machine that meets the technical specifications, install the Backup Agent on that machine and run the backups from there.
If you want to track down which process is locking the file, you can use utilities such as Process Explorer to do that. Once you determine which process is locking the files during backups, you should be able to decide how, and if, this is something you can prevent.