FreeFileSync and RealTimeSync interacting

Get help for specific problems
Posts: 7
Joined: 25 Jul 2020

MikeF

I've got FreeFileSync on macOS set up to run an ffs_batch job on a schedule (19:00 daily), to do a mirror sync from folder A to folder B.

I've also got RealTimeSync monitoring the same folder A for changes, and running the same batch job when these occur.

However, I find that when the FFS job runs on its schedule, it also triggers several (variable: up to 20) instances of RTS, running at intervals equivalent to the minimum idle time.

Is there any way to stop this? (I want to keep the 'security' of running FFS on a regular schedule).
User avatar
Posts: 2270
Joined: 22 Aug 2012

Plerry

Read the last alinea of the RealTimeSync Manual page.
As the taskscheduler has launched FFS rather than RTS, RTS is not stopped/paused during the execution of the taskscheduler launched FFS instance.
Instead of having the taskscheduler just launch FFS, you may consider to have the task scheduler launch a script (e.g. a *.bat, *.cmd or shell-script) that first stops RTS, then launches FFS, and afterwards starts RTS again.
Posts: 7
Joined: 25 Jul 2020

MikeF

Thanks for this advice.

I've created the following shell script, which may be of use to other macOS users:
#!/bin/zsh

# Script to stop RTS, run schedule FFS batch job, restart RTS

killall RealTimeSync
killall RealTimeSync_i386

sleep 5

open -a FreeFileSync ~/Documents1/FreeFileSync/Personal.ffs_batch

sleep 10

open -a RealTimeSync ~/Documents1/FreeFileSync/Personal_RT.ffs_batch
(The 2 batch files do the same thing - it's just that I name them differently so that I can distinguish them in the log.)

I've created a simple launchd job to run this on a regular schedule (daily at 19:00).
User avatar
Posts: 2270
Joined: 22 Aug 2012

Plerry

I am not familiar with MacOS and scripting in MacOS.
Does an "open -a" command wait until the following instruction has ended?
And even then, this may not be sufficient.
See e.g. the discussion on scripting here.
Or are you sure FFS will finish the sync within the "sleep 10"
(seconds? minutes?) pause?
Posts: 7
Joined: 25 Jul 2020

MikeF

I don't believe that 'open -a' waits, and so 'sleep 10' (seconds) will not be sufficient in all cases.

Instead, I'll look at using 'Run a command: On completion' in the FFS synchronisation settings.
Posts: 7
Joined: 25 Jul 2020

MikeF

A little Googling identified the -W flag for 'open', so:
open -W -a FreeFileSync ~/Documents1/FreeFileSync/Personal.ffs_batch
ensures that FFS finishes before restarting RTS.
User avatar
Posts: 2270
Joined: 22 Aug 2012

Plerry

Still, as stated before, that may not be enough. See the link in my earlier reaction today.
But possibly for MacOS things may be different ...
But the 'Run a command: On completion' option may solve the issue.