When the sync ends, make an action

Discuss new features and functions
Posts: 2
Joined: 29 May 2019

Dreagnout

I want to make an action when the sync finished succesfully, like run a batch or powershell file (my objetive is when this batch or powershell file, clean specific folder), it's that possible?

Thanks.
User avatar
Posts: 143
Joined: 8 Mar 2017

Radish

https://freefilesync.org/manual.php?topic=synchronization-settings

Basically:
(1) Select one of your synchronisation files.
(2) Press the F8 key and synchronisation settings for that synchronisation job will open up.
(3) Look to the bottom right of that dialogue window you will see an item titled "Run a command:"
(4) Enter what you want do in the appropriate text box and use the drop-down to select the trigger for the action you want for that synchronisation job.

I've never used this function myself so if you want to run a batch and can't get it to work post back here and ask for help from someone more knowledgable.
User avatar
Posts: 2451
Joined: 22 Aug 2012

Plerry

You indicate you only want to run an action when the sync finished successfully.
That is not directly possible.
But in a script you can evaluate the FFS return code and take action depending on the return code value.
User avatar
Posts: 143
Joined: 8 Mar 2017

Radish

I'm puzzled, Plerry. If I look at the options for Synchronisation Settings > "Run a command:" one of the options in the drop-down there is "On Success:"

Or am I reading that all wrong?

EDIT: P.S. On reading the information from the link you provide I can see why the method you point too has advantages over what is available from the drop-down.
User avatar
Posts: 2451
Joined: 22 Aug 2012

Plerry

There is always an opportunity to learn something new …
I never noticed there are other options available than "after completion" …
I suppose that On Succes corresponds to return code 0 : "Synchronization completed successfully".
It is not clear if On Succes also includes return code 1: "Synchronization completed with warnings"
User avatar
Posts: 143
Joined: 8 Mar 2017

Radish

It is not clear if On Succes also includes return code 1: "Synchronization completed with warnings" Plerry, 23 Jul 2019, 10:01
Yes, that was the kind of (after-) thought I had when reading your method -- it offers the user a bit more control because return code can indicate conditions that the "On Success" drop-down setting might not be indicating. Depends how On Success is interpreted I suppose.