Is it needed the sync.ffs_lock file when I mirror in one direction?

Discuss new features and functions
Posts: 14
Joined: 22 Aug 2020

daimroc

Suponse that I have a server and a remote computer.

In my remote computer I install FFS for realmtime monitoring and watch a folder in the server.

For security reasons, the remote folder only can read files in the folder in the server, so I get an error that tells that it is not possible to create the file sync.ffs_lock in the server. It is normal.

If I am not wrong, this file it is to force only one FFS to access to the folder while another FFS is doing the sync. But if FFS can't modify the source folder in the server, just sync in one direction, is it useful? I mean, the second FFS will see the same another FFS is syncing or not.

I guess it is useful in a bidirectional sync, or when the sync would be from remote computer to server, becaues then the second FFS oculd find inconsistences. But in this case I am not sure if I could have problems that I don't realize.


Thanks.
Posts: 8
Joined: 14 Jun 2016

JustOneLook

It's not about another FFS. It's about making the sync or mirror operation FFS-exclusive, i.e. no other process can access the "copy to" folder while the sync or mirror operation is running. This is a recommended default setting of FFS in order to keep the "copy to" side clean and uncorrupted. The sync.ffs_lock file is created to sort of test if FFS can get exclusive access. Assuming the "failsafe" copy option is still activated (which it normally should be to keep the right side in an uncorrupted and clean state) not being able to have the sync.ffs_lock file created means you can't perform the sync or mirror operation. You need to assign the folder on the server the appropriate rights first.
Posts: 14
Joined: 22 Aug 2020

daimroc

I am doing some tests and I realized that the sync_ffs_lock is created in both folders, in the source and in the destionation.

However, while the sync is running and the lock files still exist, with the file explorer (that is another process) I can create files, remane folder... etc, in both folders, in the source and in the destination. So I really don't understand what do you mean that FFS locks the folder to avoid to any process can do modifications.

But If I try to run another FFS instance to sync the same folder, in this case this second FFS is stucked in the scanning process, so it is waiting until the first FFS will finish.
Posts: 14
Joined: 22 Aug 2020

daimroc

In the documentation it is said this:

"LockDirectoriesDuringSync:
In order to prevent multiple synchronization tasks from reading and writing the same files, FreeFileSync instances are serialized with lock files (sync.ffs_lock). The lock files are only recognized by FreeFileSync and make sure that at most, a single synchronization is running against a certain folder at a time while other instances are queued to wait. This ensures that only consistent sets of files are subject to synchronization. The primary use case are network synchronization scenarios where multiple users run FreeFileSync concurrently against a shared network folder."


So it is seems that this file it is used only by FFS to ensure that 2 FFS that are sync the same folder could do modifications at the same time.

So I think that if I have a server and 2 remote computers, and I install FFS in the remote computers and they only read from server in a mirror sync from server to remote computers, I could disable this option with no problems, but I would like if this is really true or not.
User avatar
Posts: 3583
Joined: 11 Jun 2019

xCSxXenon

Correct, the first reply is completely wrong. The lock file is created by and is only for FFS. It is true, you don't need a lock file in the source of a mirror sync for your case. Consider this: What if you have FFS on a third computer that can write/delete data from the server? You don't want that to be happening while copying from the server on the first computer. Just something to be mindful of. Unfortunately, you can't disable them per-sync and can only disable them for FFS as a whole.
Posts: 14
Joined: 22 Aug 2020

daimroc

Yes, I understand if another FFS will modify the source, it is better to lock, but in my case the flow of the copy will be always from source to backup computers, FFS while never modify the source folder.