Folders selected for synchronization have a hidden .sync/Archive directory inside. This directory stores old versions of updated or deleted files: if a remote agent updates a file, other agents move their local copies to Archive. Archive can be a good source to restore unintentionally deleted files or their previous version.
Archive's behavior is configured in Profile:
- Max archive file size (MB): the max size of a file that will be moved to Archive. Increase it if you work with big files. Bear in mind that this will require much storage space to keep the files' versions.
- Max archive file age (days): number of days a file remains in Archive until automatically removed for good. The longer it's kept, the longer it takes storage space. Decreasing this value makes sense on limited storages. You can manually clear Archive every now and then so as not to wait for automatic deletion.
Archive on mobile devices works the same way but has the following peculiarities:
- Files are kept there for 1 day only and this cannot be changed.
Archive role in processing file rename
From system's point of view renaming is deleting old_filename and creating new_filename. Hash of the file remains the same. When a remote agent renames a file, other agents can process it through Archive: move old_filename to Archive (once it's deleted on remote agent) and instead of re-downloading the new_filename, take it out from the Archive. It saves time and network bandwidth.
Archive in Synchronization job
In Sync job all agents create .sync directory. Agent understands that a file is updated if notices that its 'modified time' and/or size have changed. Agent receives system notifications about file update. If a notification fails for a reason, agent discovers new file when rescanning the folder, which is performed periodically every 10 minutes by default.
Agent will recheck the file and, if it has read-write permission in the job, will upload the new version to other agents. Others will move their current file to their Archive folder and download the updated file. The agent where file was locally updated does not store the older file's version!
When file is deleted
If an agent deletes file to its recycle bin (or skips it), other Agents will move the file from the syncing folder to their Archive. Agent will consider a file to be deleted if file is not located in its place. Deleted file will not be moved to Archive on the agent who initially got it deleted off its file system!
Restoring files from Archive
When placed there, file gets the current "created" timestamp, but the "modified" timestamp is preserved. If Archive already has a file with same name there, new one gets (i) index, increments by +1.
These markers can help identify the wanted file in case you need to restore one of the older versions. Resilio Connect does not support automatic restoring of files, this can be done only manually though a file manager - just move or copy the file out of Archive to its place in sync folder. Remove the (i) index or rename the file as you need.
An agent must be online when you take a file out of Archive. The thing it that this file will have the "modified" timestamp older than that on other agents. If Agent runs , it can detect the file change and upload it to others. If it does not run, it will detect the restored file only when rescanning the folder, will compare "modified" timestamp with that from other agents and again move it to Archive as being older.
Archive in Transfer jobs
In transfer jobs only destination agents create .sync directory. Since transfer jobs are not continuous syncing but rather a one-time file transfer archive on destination agents works with the following peculiarities:
- Files updated on source agent end up in Archive on destinations only upon the next job run.
- If Agent profile has option "Delete files absent on source agent (Transfer jobs)" set to Yes, the deleted files are NOT placed to Archive on destinations.
- If file is renamed on source, it's re-synced to destination agents on next job run. File rename is not processed through archive