Concept
FolderSync works by synchronizing the contents of two folders. These two folders must be different and can be located on your Android device, on your file server or in cloud storage.
The typical use case is syncing a folder on your Android device with a folder in Google Drive, for example to backup files from your device or to enable offline access to files on your device, that would otherwise only be located in the cloud.
FolderSync allows you to freely select any folder it can access when configuring the folderPair sync.
File comparison
When syncing FolderSync makes a record of each file and its filepath locations in the two configured folders. On subsequent syncs the modified time of the file will be used to determine if a file has been updated. The modified time is also used to compare the same file in the two corresponding folders to determine which one is newer. If both files have changed since the previous sync, there will be a conflict and FolderSync will take no action - you can override this conflict behavior in the folderPair settings. If only one files has been updated, it will overwrite the older file.
For folderPair V1 it is also possible to enable calculation of checksum for local device files. This ensures a more robust detection mechanism to determine if a file has changed, but can take considerably longer depending on the size and number of files. For V2 folderPairs this is enabled by default, but can be disabled if you prefer faster syncing. In many cases checksum calculation is not needed, but a few niche apps updates file contents without changing the modified time of the files. In those cases checksum calculation is needed for FolderSync to be able to detect a file had changed.
Using for backup
FolderSync can be used to backup files, but it will not retain files if you configure a folderPair to also sync deletion of files. As the name implies FolderSync works by synchronizing content of folder and if you delete files, then deletions will be synced as well and deleted files will no longer be available. Sync deletions are disabled by default, so unless enabled by the user, FolderSync will never delete files.
Similarly FolderSync will not retain older versions of files that are overwritten by newer files. FolderSync cannot restore deleted or old versions of files.