How to start multiple jobs but let them run sequentially, as opposed to in parallel?

Discuss new features and functions
Posts: 4
Joined: 14 Jul 2024

TradeWinds

In a simplified example, say I have 2 ffs jobs:
(1) sync a main copy to a backup
(2) sync the backup to "the backup of backup"

I want to run them sequentially in a script, 1 followed by 2, not in parallel, otherwise the "backup of backup" may not get the latest change made in the main copy.

I can't seem to find a way to do them sequentially in a script, starting from the gui, I've tried:
- select both jobs and click "Synchronize".
- select both jobs, Save As a new gui job which contains 2 pairs, then run the new gui job.
- select both jobs, Save As a new batch job which contains 2 pairs, then run the new batch job.

In all of the above, the 2 pairs seem to run in parallel.

I could design some workflow to run the 2 jobs separately, with some time apart, but that's not very elegant, I'd much prefer to know if it's possible to configure FFS to run them sequentially. Thanks!
User avatar
Posts: 2450
Joined: 22 Aug 2012

Plerry

In a simplified example, say I have 2 ffs jobs:
(1) sync a main copy to a backup
(2) sync the backup to "the backup of backup"
Why would you take this approach?
Simply sync your "main copy" to your (1st) backup, and sync your "main copy" to your 2nd backup, your "backup of the backup".
Then you copy straight from the source to both backups; less risk of data corruption somewhere in between.

Besides that, you can now run both syncs in one and the same FreeFileSync (FFS) instance (using multiple left-right pairs; there is no risk that the sync to your 1st backup is not finished yet, because the data for your sync to your 2nd backup comes straight from your real source, which is obviously up-to-date.
You can also run the two syncs in parallel in separate FFS instances, but unless you set the LockDirectoriesDuringSync flag to False, they will still run in sequence (the sequence now being irrelevant).

If you nevertheless insist in your approach as quoted above, you can start your FFS sync (1), and after that one is running, start your FFS sync (2), provided your LockDirectoriesDuringSync flag is set to True.
You can also have your sync (2) started upon completion of your sync (1), by adding the suitable Command Line to start your sync (2) in the Run a Command (On Completion) in the Sync Settings (F8) of sync (1).
Or you can write any suitable script (e.g. a *.bat or *.cmd file) that starts your sync (1), waits until sync (1) has ended (e.g. via a CALL or using the /wait option) and then starts sync (2).
Posts: 4
Joined: 14 Jul 2024

TradeWinds

Or you can write any suitable script (e.g. a *.bat or *.cmd file) that starts your sync (1), waits until sync (1) has ended (e.g. via a CALL or using the /wait option) and then starts sync (2).
Thanks very much for you reply! I want to know more about the CALL or /wait you mentioned. Are they a feature of FFS? I didn't find them in `FreeFileSync.exe --help`. Or are they a feature of cmd?

(Unimportant) as for the reason why I chose the approach to backup my backup, as mentioned in the beginning of OP, it was a simplified example. In reality, my job1 is to backup %UserProfile% to a NAS, and the subsequent job2 is to backup the whole NAS to a DAS. Naturally, job2 includes much more data then job1. As for why I backup the whole NAS to a DAS using Windows, it's because the DAS will be backed up to BackBlaze Personal, which is the only economical way to backup the whole NAS to some cloud.
User avatar
Posts: 2450
Joined: 22 Aug 2012

Plerry

I refer to the CALL or Start /wait instruction when talking about scripting.
Those are *.bat and *.cmd commands; not part of FFS.
An excellent reference for *.bat or *.cmd scripting is https://ss64.com/nt/.
In reality, my job1 is to backup %UserProfile% to a NAS, and the subsequent job2 is to backup the whole NAS to a DAS. Naturally, job2 includes much more data then job1.
You can still do this with FFS without the need to wait until your sync (1) (%UserProfile% to a NAS) is finished:
Have one sync using two left-right pairs:
%UserProfile% => NAS (in the suitable NAS folder, e.g. UserProfile)
%UserProfile% => DAS (in the suitable DAS folder, e.g. UserProfile)
This will sync your %UserProfile% folder to both your NAs and your DAS
and have a second sync
NAS => DAS, in which you add the UserProfile folder to the FFS Exclude Filter
This will sync your NAS share to your DAS, except your UserProfile folder.