Available from: Resilio Active Everywhere v4.1.0
Supported for: Distribution jobs, local storages and cloud storages.
This guide outlines the best practices for administrators when using the new "Before finalizing download" featured trigger, designed to facilitate file server updates by unlocking files in use during the Distribution job process. The feature is particularly useful for, but not limited to, environments where SMB shares are mounted across multiple workstations, and users have files open that prevent updates.
This feature operates on a per-agent basis, not affecting all Agents at once, providing a more granular control.
Challenge: Files opened by users on SMB-mounted workstations prevent file server updates.
Solution: Forcefully unmount the SMB share in "Before finalizing download" trigger to complete file download, and remount the share and "After an Agent completes downloading" trigger.
Configuring the trigger
The trigger is added to the Distribution job.
This trigger is executed on destination Agents before they complete the file download. If the trigger is enabled in the job, the Agent downloads the files from source into a temporary folder <job path>/.sync/tmp_files/
, executes the trigger and after successful result, moves the downloaded files from the mentioned temp folder into their locations. For partly pre-seeded folder, only file's difference will be downloaded to temp destination folder.
If scheduled, the trigger is executed at Agent's local time
Three new statuses can be observed in the job run in this regard:
1. waiting for pre-move script execution
2. executing pre-move script
3. moving files
Moving the files is usually a nearly instant task, however, in some cases this operation may be slow or even fail for a reason, e.g. a slow storage, issues with path or files availability, etc. To address this, the system includes a retry mechanism for failed move actions. This interval is set to 60 seconds by default, during which the job run will remain in progress. The interval can be adjusted as needed using a custom parameter transfer_pre_move_retry_interval
(in seconds, zero disables retries causing the Agent to consider the job a failure if the move operation cannot be completed).
Best Practices for Script Management
- Ensure that the "Before finalizing download" trigger (unmounting script) and "After an Agent completes downloading" trigger (remounting script) are thoroughly tested in a development environment before deploying to production.
- Consider potential issues that could arise from forcefully unmounting SMB shares, such as data loss or corruption, and handle them within the scripts.
- Inform users of potential downtime or interruptions when the SMB shares are forcefully unmounted. Proper communication can prevent confusion and ensure users save their work before the operation.
- Mind path length. Placing files to a temp folder might be blocked by a too long file path. Agent reports error in this case.