Sync Read Only Folder

Discuss new features and functions
eswno
Posts: 15
Joined: 10 Jan 2017

Post by eswno • 13 Jan 2017, 15:01

I want to sync read only files from a server to local computer, but got an error:

Cannot set directory lock ...
Cannot write file ....\sync.ffs_lock
Error Code 5: Access is denied. (CreateFile)

Is there anyway to do such sync without create the lock file or create the lock file elsewhere?

fredphoesh
Posts: 1
Joined: 13 Jan 2017

Post by fredphoesh • 13 Jan 2017, 18:27

Hi all,
I have just joined the forum to try solve the exact same problem...

Help much appreicated...

Mark.

User avatar
Zenju
Site Admin
Posts: 4744
Joined: 9 Dec 2007

Post by Zenju • 14 Jan 2017, 10:19

You can disable FFS's directory locking, but should only do so if you can confirm that no other sync jobs may be running concurrently against the to be synced folders: See global option LockDirectoriesDuringSync

Jerome
Posts: 3
Joined: 11 Feb 2019

Post by Jerome • 11 Feb 2019, 22:21

Hello. I understand that FreeFileSync needs to lock the target directory. However, is there a way to disable the lock files on the source directory only ? Indeed I need to disable the lock file on source directory in order to avoid starvation of the FreeFileSync clients. This is an additionnal reason for this feature than "eswno" explained.
In my team, several users are copying a network directory to a their local directory. Then they can use this copy when they are out of office (even if they have access to the Internet, since our network directory will never be wired to the Internet). When they come back to the office, their computer is copying again the network daily. The network directory has no performance problems and it can afford many parallel copies at the same time.
Do you have a feature for that ? If not, did you planned to provide such feature ? Do you have a workaround ?
Thanks.

User avatar
Plerry
Posts: 562
Joined: 22 Aug 2012

Post by Plerry • 12 Feb 2019, 07:55

If you set the LockDirectoriesDuringSync option to False, that applies to both the left (commonly the source) and the right (commonly the destination) location. There is (at least presently) no option to only set the option just for one of the two locations.
But, if you only run one-way syncs from a shared network source location to the individual client locations, there should not be any risk in setting the LockDirectoriesDuringSync option to False on the clients running the FreeFileSync sync.

Jerome
Posts: 3
Joined: 11 Feb 2019

Post by Jerome • 12 Feb 2019, 21:07

Could a single user run simultaneously two instances of FreeFileSync (for example : one by the task scheduler on the behalf of the user) ?
Could we have an enhancement which splits the current 'LockDirectoriesDuringSync' option into 2 parameters ? We could get one option for the source (for example 'LockSourceDuringSync' and one for the target 'LockTargetDuringSync' ? Moreover, the new option for the source will possibly match the former need of eswno and fredphoesh (when the source directory is in "read only" mode).

User avatar
Plerry
Posts: 562
Joined: 22 Aug 2012

Post by Plerry • 13 Feb 2019, 08:45

Yes, you can run multiple instances of FFS in parallel.
As long as there is no overlap between neither the left nor the right location (in whole or in part) of the multiple syncs, there should not be a problem, even when not locking the directories involved.

About the enhancement you suggest: that is up to Zenju, the developer of FFS.
However, it may seem simple for your specific use-case, but it has to fit all FFS use-cases.
Such option can e.g. not be along the line of LockSourceDuringSync and LockTargetDuringSync as, depending on the type of sync that is defined, the Source and Target may differ per file.
So, don't count on such option becoming available any time soon, if at all.

For your use-case, if the network directory is always the source, disabling directory locking (at both sides) should be safe for your sync.
But remember: directory locking is a global FFS option defined at user level (at least for Windows); it can not be defined per individual sync.
If you need to be able to also run FFS syncs with directory locking enabled, you may run those syncs under different user credentials, using different settings for the global FFS option on directory locking.

Jerome
Posts: 3
Joined: 11 Feb 2019

Post by Jerome • 16 Feb 2019, 15:10

When I speak about starvation, there are 2 cases. The first case is the multiple access from several users to the same network directory. The second case is the network link which becomes broken and it lets the network directory with a lock file on it.