Sync to/from a network share: code/fix review

Get help for specific problems
Posts: 5
Joined: 6 May 2015

saxophone2015

I was facing an issue to sync from local folder to a network share, in only one direction, local ---> share

On boot, or if the share was offline, it would end with useless prompts from task manager
Worst, I imagined the share folder name exists while its contents are not yet mounted causing a full overwrite of data!

I wrote this .bat file to run before the FFS batch script
Notice the share.refreshed file I created in th eroot of each of my 2 shares (backup and media)

<code>
@ECHO OFF
ECHO ..........................................
ECHO . .
ECHO . FreeFileSync Task .
ECHO . Started on %date% at %time% .
ECHO . .
ECHO ..........................................
ECHO.
ECHO Waiting for \\RNDU2000-1 Shares...
ECHO.

:LOOP
IF NOT EXIST \\RNDU2000-1\c\backup\share.refreshed GOTO SKIP01
IF NOT EXIST \\RNDU2000-1\c\media\share.refreshed GOTO SKIP01
ECHO Found! Continuing with Network Sync...
EXIT 0

:SKIP01
REM 60 seconds delay...
TIMEOUT /T 60 /NOBREAK > NULL
GOTO LOOP

</code>

I read in another post on potential bugs with sync to/from a network. Is my fix overkill? Is there a way to make FFS aware of network/drive paths and wait for them?
Also, would be great if there was a drive check by its id and not drive letter
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

For the record, there are no known bugs with regards to network shares, e.g. FreeFileSync will handle temporal network drops at any stage without data loss.
If you are still seeing a real problem or risk in this area, I'd be interested in analyzing further.

That said, the current network connection handling is implicit. If FreeFileSync finds an unconnected network share it tries to connect first, possibly showing prompts to the user. For future versions I'm planning to make this explicit by allowing the user to enter user name and password (show encoded for more privacy on GUI?) directly in FreeFileSync.