1. Overview and configuration
2. Archive role in processing file renames and file deletions
3. Archive in Synchronisation jobs
4. Archive in Distribution and Consolidation jobs
5. Restoring files from Archive
Overview
Folders selected for synchronization have a hidden .sync/Archive directory inside. This directory stores old versions of updated or deleted files: if an Agent updates a file, other Agents move their local copies to the Archive. The archive can be a good source for restoring unintentionally deleted or modified files.
The archive's behavior is configured in the Agent's Profile:
-
"Use Archive" option enables or disables the archival feature entirely. In Resilio Connect versions prior to 2.12, this setting only applies to newly created sync jobs and has no effect on existing ones.
"Max Archive File Size (MB)" sets the maximum size of a file that will have its previous versions stored in the Archive. If you frequently work with large files and need version history, consider increasing this value—but keep in mind that doing so will require more storage space.
"Max Archive File Age (days)" defines how long files remain in the Archive before they are automatically deleted. A longer retention period ensures file versions are available for a greater time but also consumes more storage. If storage is limited, reducing this value is recommended. You can also manually clear the Archive if immediate cleanup is needed. Starting from v3.6.0, this parameter can also be set as a custom parameter within a Job Profile, allowing it to be applied selectively to specific jobs.
On Android devices, archived files are retained for 1 day only, and this setting cannot be modified.Note: Files remaining in the Archive from previous job instances (e.g., after recreating or restarting a job using the same directories) are not automatically cleared. Only files archived during the current job execution are subject to automatic cleanup based on the configured age setting.
It is recommended to restart the Agent service whenever you change any of the archive-related parameters so that these changes are applied correctly.
The Archive Folder's purge operation is triggered by the Agent or Job periodic scan option in the Agent or Job profile.
Archive role in processing file renames and file deletions
From the system's perspective, renaming a file is treated as a two-step process: the old file is deleted, and a new file is created. The file hash remains unchanged. When a file is renamed, other agents handle the operation by moving the old file to the Archive. Instead of re-downloading the renamed file, the agents retrieve it from the Archive, saving both time and network bandwidth. For more information about how renames are handled, refer to the detailed documentation here.
When a file is deleted, other agents will move the file from the syncing folder to their Archive. A file is considered deleted when it is no longer present in its original location on the agent.
Archive in Synchronization jobs
In a Sync job, all agents create .sync directory. An Agent understands that a file is updated if it receives a system notification about it or if it detects a change during the period folder scan.
Upon change, the Agent will recheck the file and, if it has read-write permission in the job, it will upload the new version to other agents. Others will move their current file to their Archive folder and download the updated file.
An important note: the agent where the file was locally updated does not store the older file's version!
Archive in Distribution and Consolidation jobs
With these Jobs, only the destination agents create .sync directory. Since transfer jobs are not continuously syncing (but rather a one-time file transfer), the Archive on destination agents works differently:
- Files updated on the source agent end up in the Archive of the destination agents only upon the next job run.
- If the Agent profile has the option "Delete files absent on source agent (Transfer jobs)" set to Yes, the deleted files are NOT placed in the Archive of the destination agents.
- If a file is renamed on the source, it's re-synced to the destination agents on the next job run. File rename is not processed through the Archive.
Restoring files from Archive
To open the Archive:
- enable hidden items in the file browser and navigate to .sync directory manually (for Linux)
- right-click on the job in the Agent UI and select Open Archive (works only for Sync Jobs, only for macOS and Windows non-cloud Agents)
When files are added to the Archive, their "modified" timestamp reflects the time they were placed there.
If the Archive already has a file with the same name, the new version one gets (i) index, increments of 1.
This meta-data can help identify the file version that needs to be restored.
Resilio Connect does not support automatic restoring of files, this can only be done manually using a file manager - just move or copy the file out of the Archive back to its original. Remove the (i) index or rename the file as needed.
Important: an agent must be running when you take a file out of the Archive. The file has a "modified" timestamp older than that on other agents. If the Agent is running during the restore operation, it detects the file change and uploads it to others. If it is not running, the restore operation will fail - the file will be overwritten by the file with the more recent "modified" timestamp.