Commandline Parameter for Mirror

Get help for specific problems
Posts: 2
Joined: 14 Jun 2021

Puckmeister

Hi there,
i have a shortcut in my file manager to open both panes i actually see in freefilesync. Unfortunately the synchronization setting is always "mirror". Is there a parameter to use "two-way" as default when coming from the commandline?
Thx in advance!

Best, Puckmeister
User avatar
Posts: 2946
Joined: 22 Aug 2012

Plerry

Never tried this, but this may/should work:
Define a FFS two-way sync configuration using Macros (See the hint at the bottom of the page) for your left and right base location, and save that FFS sync configuration.
Then, define the correct environment variables, and launch FFS, opening the saved FFS configuration.

Alternatively, you may manipulate a saved two-way sync configuration by a script, replacing the stored left and right base location by your personal locations, saving the FFS configuration file (under a different name) and the invoke FSS, opening this newly saved FFS configuration file.
Posts: 1202
Joined: 8 May 2006

therube

Doesn't seem there is a way to pass your wanted sync method via command line. (RFE)

Seems the method, "variant" is stored in .ffs_gui files (probably .ffs_batch too?), not in the .xml.
But even if, say, LastRun.ffs_gui shows:
    <Synchronize>
        <Variant>TwoWay</Variant>
FFS still shows it will perform a Mirror sync?

I suppose you're using -dirpair ?

(basically as said above:)
If you can script output to a .ffs_gui (& in there you set 'TwoWay'), that would load & set the sync method as TwoWay.

The .ffs_gui could be boiler-plate with only the need to pass your wanted directories to it.
(I'll leave those nitty gritty details to you ;-).)
freefilesync.exe   called_from_Salamander.ffs_gui
Posts: 1202
Joined: 8 May 2006

therube

Macro method with .ffs_batch:
SET DirL=C:/TMP/1
SET DirR=C:/TMP/2
C:\FreeFileSync\FreeFileSync.exe   C:\FFS_PROFILES\go.ffs_batch   -EDIT
<?xml version="1.0" encoding="utf-8"?>
<FreeFileSync XmlType="BATCH" XmlFormat="17">
    <Compare>
        <Variant>TimeAndSize</Variant>
        <Symlinks>Exclude</Symlinks>
        <IgnoreTimeShift/>
    </Compare>
    <Synchronize>
        <Variant>TwoWay</Variant>
        <DetectMovedFiles>false</DetectMovedFiles>
        <DeletionPolicy>RecycleBin</DeletionPolicy>
        <VersioningFolder Style="Replace"/>
    </Synchronize>
    <Filter>
        <Include>
            <Item>*</Item>
        </Include>
        <Exclude/>
        <TimeSpan Type="None">0</TimeSpan>
        <SizeMin Unit="None">0</SizeMin>
        <SizeMax Unit="None">0</SizeMax>
    </Filter>
    <FolderPairs>
        <Pair>
            <Left>%DirL%</Left>
            <Right>%DirR%</Right>
        </Pair>
    </FolderPairs>
    <Errors Ignore="false" Retry="0" Delay="5"/>
    <PostSyncCommand Condition="Completion"/>
    <LogFolder/>
    <EmailNotification Condition="Always"/>
    <Batch>
        <ProgressDialog Minimized="false" AutoClose="false"/>
        <ErrorDialog>Show</ErrorDialog>
        <PostSyncAction>None</PostSyncAction>
    </Batch>
</FreeFileSync>
So that should work.

Note that when that is run, the directory pairs actually show %DirL% & %DirR% rather then displaying the resolved name (in the GUI).
Nonetheless, it does know the correct directories & should work correctly.
And your wanted Sync method, TwoWay, is correct too.
Posts: 2
Joined: 14 Jun 2021

Puckmeister

Wow that was fast, thx for the suggestion and the confirmation that this option is actually not existent.

I used your ffs_batch-file and created a small auothotkey script to change env-variables instead of the speedcommander macros, but the logic is the same.
Works fine, thx again!