Wsyncr runs as a Windows service.  It provides the source-side portions of WANFast's real-time replication.  It receives file system event notifications from the wsyncd driver, filters them to remove unwanted events, and then propagates the changes to the target machine at specified intervals.

There are two ways by which you can control the behavior of wsyncr.  Command line options can be specified during program start up by using the Windows Services manager to specify start parameters.  However the preferred approach is to add the options to its configuration file, wsyncr.cfg. 

From the command line you can use either the short or long form of the option.  The short form is -F V, where F is the one-character option and V is the value (if required).  The long form is --option-name=option-value with no spaces between the name, '=', and value.  If the value includes spaces, such as for a path name, enclose the value in double quotes, e.g., --option-name="option value".  When using an option in the configuration file, use the long form of the option without the leading "--".   In the configuration file it is OK to have spaces between the option name, '=', and value, and OK to have spaces in the value.  You can add a comment line to your configuration file by starting the line with '#'.

You can modify the behavior of the running program by using either the wsyncClient CLI or wrepl GUI and issuing a replication command.  These are explained below in the section Online Commands. 

By far the easiest way to configure wsyncr is by using the wrepl graphical user interface (GUI) to set up the configuration, and then using the Save Settings button to save the configuration to the program's configuration file.

wsyncr Syntax and Options

 SYNTAX: C:\Program Files\WANFast\wsyncr.exe [OPTIONS] [UserName@Address]
    [-m X:,M:[,state] | --map-drive=X:,M:[,state]]
        Map a local volume to a remote volume/path
        Optionally specify initial volume state.  See values below
    [-u X:    | --unmap-drive=X:]         Unmap the specified local volume and stop any operation
    [           --initial-state=X:,off|once|cont|sync|run]
        Set the starting volume state = off, once, cont, sync, or run.
        Specify a single volume or Use *: to set for all mapped volumes.
    [-s X:,off|once|cont|sync|run | --state=X:,off|once|cont|sync|run]
        Set the current volume state = off, once, cont, sync, or run.
        Specify a single volume or Use *: to set for all mapped volumes.
    [-r       | --run]                    Immediately start all specified wsyncr operations
    [           --sync]                   Immediately start all initial volume sync operations, but not replication
    [           --sync-once]              Start in sync mode.  Sync all mapped volumes one time and then shut down
    [           --pause]                  Complete current operations.  Do not begin any new operations
    [           --stop]                   Stop all running operations. Start wsync in the inactive state
    [           --stop-peer]              Shut down peer after successful --sync-once
    [-T int   | --max-unread-time=int]    Maximum interval (seconds) between reading kernel replication records
    [-B int   | --max-process-time=int]   Maximum length of time the processor waits to consolidate file events
    [-S int   | --vss-interval=int]       Use VSS snapshots for sending replication. Set interval between snapshots.
    [           --sync-interval=int]      The pause time in seconds between repeating a continuous sync
    [-H       | --hide-unmapped]          Toggle the display of unmapped volumes
    [           --max-records=int]        Maximum number of kernel replication records
    [           --max-unread-records=int] Maximum unread kernel replication records
    [-Z int   | --max-name-cache=int]     Maximum name cache size
    [           --sync-file-dir=path]     The directory path to store replication buffer files
    [           --max-file-size=int]      Maximum size of a replication file
    [           --max-fifo-memory=int]    Maximum memory consumed by sync fifo
    [           --dr-exclude=path]        Replication exclude path enforced within the driver (no regex)
    [           --dr-exclude-casei=path]  Case insensitive replication exclude path enforced within the driver (no regex)
    [           --dr-include=path]        Replication include path enforced within the driver (no regex)
    [           --dr-include-casei=path]  Case insensitive replication include path enforced within the driver (no regex)
    [-X path  | --repl-exclude=path]      Replication exclude path
    [-I path  | --repl-include=path]      Replication include path
    [           --repl-flush]             Remove all replication filter patterns including the defaults
    [           --sync-exclude=path]      Replication exclude rule used for initial wcp volume sync
    [           --sync-include=path]      Replication include rule used for initial wcp volume sync
    [-P path  | --pattern-file=path]      File containing include/exclude paths for the driver, replication and sync
    [-N       | --numeric-ids]            Use numeric IDs when transferring file attributes
    [           --name-ids]               Convert IDs to user/group names when transferring file attributes
    [           --compress-fifo]          Compress the on-disk queue of replication events.
    [           --no-compress-fifo]       Do not compress the on-disk queue of replication events.
    [           --use-recycle-bin]        By default wsyncr deletes files rather than use the recycle.bin.
        Specify this to use recycle.bin
    [           --bg]                     Run wsyncr in daemon mode.  You will need to use wsyncClnt to talk to it.
    [-Y       | --service]                Run as a Windows service
    [-a port  | --api-port=port]          Specify the TCP port on which to access wsyncr when in background mode.
    [           --no-attr-errs]           Do not print warnings on failure to set attributes
    [           --delete-first]           Delete files before creating to conserve disk space
    [           --log-changes]            Log all changes to file system
    [           --vol-opts=string]        Add volume-specific wcp options, e.g. --vol-opts="D:/;--vol-copy -N"
    [           --consistent-sync]        When syncing, snap all volumes simultaneously
    [           --max-ops-ps=int]         Specify maximum replication ops to process per second to decrease system impact
[-y | --accept-hosts] Silently accept unknown hosts. [-p int | --pool-size=int] Size of connection pool [1-16] [-x MBPS | --max-bandwidth=MBPS] Max bandwidth per VC in mbps [MBPS=int]. [-c | --compress] Compress all data transfers [-C | --no-compress] Do not compress any data transfers [default] [-k | --auto-compress] Automatically determine whether to compress [-z alg | --compress-alg=alg] Specify the compression algorithm [alg=string] [-e | --encrypt] Encrypt with the default algorithm [default] [-E | --no-encrypt] Do not encrypt [-n alg | --encrypt-alg=alg] Specify the stream encryption algorithm [alg=string] [-b alg | --block-encrypt-alg=alg] Specify the block encryption algorithm [alg=string] [-i path | --identity-file=path] Identity file path. [-A path | --authorized-keys=path] Specify the path to the authorized keys file [-f path | --config-file=path] Configuration file path. [-g path | --log-file=path] Log file path. [-D int | --log-level=int] Set log level. [-Q | --quiet] Quiet output [-V | --verbose] Verbose output [ --config] Print configuration [-v | --version] Version [-q c|e | --query=c|e] List supported compression (c) or encryption (e) algorithms [-F ID | --create-key-file=ID] Create a keyfile [ID = hostname, IP, or email] [-M | --import-key-file] Import a keyfile [keyFilePath] [ID] [ --password=string] Password for private key file, if required. [ --server-port=port] Specify the WFST service port [port=int]. [ --tcp-keep-alive=int] Set the keep-alive timeout used by all TCP connections

Online Commands

Wsyncr runs as a Windows service.  While it is running, you can connect to its API port using either the wsyncClient CLI or wrepl GUI and issue any of its supported online commands to change its configuration or alter its behavior.  The CLI should be used for integration with 3rd party software or shell scripts. 

It can be used for shell scripts in a "one-shot" mode, where you run a single shell command containing one or more commands to wsyncr and receive an immediate response.

wsyncClient --ui [options] SYSTEM@HostIPOrName "Command 1; Command 2; ..."

An example is shown below.  

wsyncClient --ui -i ~/.wfst/TEST-2.key This email address is being protected from spambots. You need JavaScript enabled to view it. "list; lvols"
SESSION CLOSED
wsync
DEVICES OK
Order=1|DosName=D:/|VolName=/Device/HarddiskVolume3/|VolumeID=//?/Volume{dd984543-bfde-11eb-828c-d62dbd9fc98d}/|VolId=3|Status=-----U|State=Wait|DesiredState=Sync|NextState=Sync|LastState=Unused|ExitCode=0x0|StartsIn=--:--:--|BytesSynced=0.000 B|FilesCopied=0|BytesProcessed=0.000 B|FilesProcessed=0|PercentDone=0.0|RunTime=00:00:00
Order=2|DosName=C:/mnt/tmp/|VolName=/Device/HarddiskVolume4/|VolumeID=//?/Volume{dd984cf7-bfde-11eb-828c-d62dbd9fc98d}/|VolId=4|Status=-----U|State=Wait|DesiredState=Sync|NextState=Sync|LastState=Unused|ExitCode=0x0|StartsIn=--:--:--|BytesSynced=0.000 B|FilesCopied=0|BytesProcessed=0.000 B|FilesProcessed=0|PercentDone=0.0|RunTime=00:00:00
Order=3|DosName=C:/|VolName=/Device/HarddiskVolume2/|VolumeID=//?/Volume{db2a93a8-634a-11e6-80b4-806e6f6e6963}/|VolId=2|Status=-----U|State=Wait|DesiredState=Sync|NextState=Sync|LastState=Unused|ExitCode=0x0|StartsIn=--:--:--|BytesSynced=0.000 B|FilesCopied=0|BytesProcessed=0.000 B|FilesProcessed=0|PercentDone=0.0|RunTime=00:00:00
Order=0|DosName= |VolName=/Device/HarddiskVolume1/|VolumeID=//?/Volume{db2a93a7-634a-11e6-80b4-806e6f6e6963}/|VolId=5|Status=------|State=Unused|DesiredState=Unused|NextState=Unused|LastState=Unused|ExitCode=0x0|StartsIn=--:--:--|BytesSynced=0.000 B|FilesCopied=0|BytesProcessed=0.000 B|FilesProcessed=0|PercentDone=0.0|RunTime=00:00:00
END DEVICES
LVOLUMES OK
C:/|64.06 GB|40.79 GB|23.26 GB|63.7|/Device/HarddiskVolume2|//?/Volume{db2a93a8-634a-11e6-80b4-806e6f6e6963}/|NTFS
C:/mnt/tmp/|1.070 GB|24.71 MB|1.045 GB|2.3|/Device/HarddiskVolume4|//?/Volume{dd984cf7-bfde-11eb-828c-d62dbd9fc98d}/|NTFS
D:/|5.365 GB|4.382 GB|983.2 MB|81.7|/Device/HarddiskVolume3|//?/Volume{dd984543-bfde-11eb-828c-d62dbd9fc98d}/|NTFS
---|367.0 MB|291.3 MB|75.68 MB|79.4|/Device/HarddiskVolume1|//?/Volume{db2a93a7-634a-11e6-80b4-806e6f6e6963}/|NTFS
END LVOLUMES
EXIT OK

The output from the command can take two formats.  By default all output is in its human-readable format.  By including the --ui command parameter to wsyncClient, the output is returned in an easy to parse format.  Commands that return a single data object are in the format:

XXXX OK
Name = Value
END XXXX

 

where XXXX is the name of the object being returned.  

Commands that return a list of objects are in the format:

XXXX OK
FieldValue 1|FieldValue 2|...
...
END XXXX

where each line terminated in a carriage return represents a single object.  The field values are separated using the pipe symbol, "|".  An empty value will be returned as ||.  To display a header with the field names as the first line in the response, include the uih command as shown below/

wsyncClient --ui -i ~/.wfst/TEST-2.key This email address is being protected from spambots. You need JavaScript enabled to view it. "uih; lvols"
SESSION CLOSED
wsync
LVOLUMES OK
DosName|VolumeSize|VolumeUsed|VolumeFree|PercentUsed|VolName|DeviceId|FileSystem
C:/|64.06 GB|40.79 GB|23.26 GB|63.7|/Device/HarddiskVolume2|//?/Volume{db2a93a8-634a-11e6-80b4-806e6f6e6963}/|NTFS
C:/mnt/tmp/|1.070 GB|24.71 MB|1.045 GB|2.3|/Device/HarddiskVolume4|//?/Volume{dd984cf7-bfde-11eb-828c-d62dbd9fc98d}/|NTFS
D:/|5.365 GB|4.382 GB|983.2 MB|81.7|/Device/HarddiskVolume3|//?/Volume{dd984543-bfde-11eb-828c-d62dbd9fc98d}/|NTFS
---|367.0 MB|291.3 MB|75.68 MB|79.4|/Device/HarddiskVolume1|//?/Volume{db2a93a7-634a-11e6-80b4-806e6f6e6963}/|NTFS
END LVOLUMES
EXIT OK

A tighter integration with 3rd party software can be achieved by running wsyncClient as a long-lived subprocess and interacting with its stdin and stdout.  When used in this manner, you invoke it without any commands.  It will respond with the prompt, wsync, after which you can issue it commands as shown below, where all commands issued by the 3rd party software are in bold.  Everything else is output from wsyncClient. 

./wsyncClient --ui -i ~/.wfst/TEST-2.key This email address is being protected from spambots. You need JavaScript enabled to view it.
SESSION CLOSED
wsync
list
DEVICES OK
Order=X|DosName=X|VolName=X|VolumeID=X|VolId=X|Status=X|State=X|DesiredState=X|NextState=X|LastState=X|ExitCode=X|StartsIn=X[|(BytesSynced=X|FilesCopied=X|BytesProcessed=X|FilesProcessed=X|PercentDone=X|RunTime=X)|(BytesCopied=X|OpsProcessed=X)]Order=1|DosName=D:/|VolName=/Device/HarddiskVolume3/|VolumeID=//?/Volume{dd984543-bfde-11eb-828c-d62dbd9fc98d}/|VolId=3|Status=-----U|State=Wait|DesiredState=Sync|NextState=Sync|LastState=Unused|ExitCode=0x0|StartsIn=--:--:--|BytesSynced=0.000 B|FilesCopied=0|BytesProcessed=0.000 B|FilesProcessed=0|PercentDone=0.0|RunTime=00:00:00
Order=2|DosName=C:/mnt/tmp/|VolName=/Device/HarddiskVolume4/|VolumeID=//?/Volume{dd984cf7-bfde-11eb-828c-d62dbd9fc98d}/|VolId=4|Status=-----U|State=Wait|DesiredState=Sync|NextState=Sync|LastState=Unused|ExitCode=0x0|StartsIn=--:--:--|BytesSynced=0.000 B|FilesCopied=0|BytesProcessed=0.000 B|FilesProcessed=0|PercentDone=0.0|RunTime=00:00:00
Order=3|DosName=C:/|VolName=/Device/HarddiskVolume2/|VolumeID=//?/Volume{db2a93a8-634a-11e6-80b4-806e6f6e6963}/|VolId=2|Status=-----U|State=Wait|DesiredState=Sync|NextState=Sync|LastState=Unused|ExitCode=0x0|StartsIn=--:--:--|BytesSynced=0.000 B|FilesCopied=0|BytesProcessed=0.000 B|FilesProcessed=0|PercentDone=0.0|RunTime=00:00:00
Order=0|DosName= |VolName=/Device/HarddiskVolume1/|VolumeID=//?/Volume{db2a93a7-634a-11e6-80b4-806e6f6e6963}/|VolId=5|Status=------|State=Unused|DesiredState=Unused|NextState=Unused|LastState=Unused|ExitCode=0x0|StartsIn=--:--:--|BytesSynced=0.000 B|FilesCopied=0|BytesProcessed=0.000 B|FilesProcessed=0|PercentDone=0.0|RunTime=00:00:00
END DEVICES
wsync
lvol
LVOLUMES OK
DosName|VolumeSize|VolumeUsed|VolumeFree|PercentUsed|VolName|DeviceId|FileSystem
C:/|64.06 GB|40.79 GB|23.26 GB|63.7|/Device/HarddiskVolume2|//?/Volume{db2a93a8-634a-11e6-80b4-806e6f6e6963}/|NTFS
C:/mnt/tmp/|1.070 GB|24.71 MB|1.045 GB|2.3|/Device/HarddiskVolume4|//?/Volume{dd984cf7-bfde-11eb-828c-d62dbd9fc98d}/|NTFS
D:/|5.365 GB|4.382 GB|983.2 MB|81.7|/Device/HarddiskVolume3|//?/Volume{dd984543-bfde-11eb-828c-d62dbd9fc98d}/|NTFS
---|367.0 MB|291.3 MB|75.68 MB|79.4|/Device/HarddiskVolume1|//?/Volume{db2a93a7-634a-11e6-80b4-806e6f6e6963}/|NTFS
END LVOLUMES
wsync
exit y
EXIT OK

When exiting the program in interactive mode, be sure to specify the command as "exit y" with the "y" parameter.  This avoids having to parse the verification exchange.

The List of Online Commands 
log                 -- toggle logging of command output to log file. Currently OFF
log level VALUE     -- set the wsyncr log level to VALUE.
log clear           -- clear the contents of the wsyncr log file.
log fetch           -- fetch the contents of the wsyncr log file.  Print to stdout.
log fetch path      -- copy the contents of the wsyncr log file to the local file "path"

file path           -- copy all command output to the local file "path"
file                -- stop logging command output.

errors              -- display all file errors in the wsync log file.
errors path         -- copy all file errors in the log file to the local file "path"

pwd                 -- display the present working directory on the remote peer.

lpwd                -- display the present working directory on the local machine.

cd | chdir PATH     -- set the present working directory on the remote peer to PATH.

lcd | lchdir PATH   -- set the present working directory on the local machine to PATH.

ls | dir            -- display the contents of the present working directory on the remote peer.

lls | ldir          -- display the contents of the present working directory on the local machine.

mkdir PATH          -- create the directory PATH on the remote peer.

lmkdir PATH         -- create the directory PATH on the local machine.

mv PATH1 PATH2      -- move PATH1 to PATH2 on the remote peer.

lmv PATH1 PATH2     -- move PATH1 to PATH2 on the local machine.

rm PATH             -- remove the file PATH on the remote peer.
rm -r PATH          -- remove the directory PATH on the remote peer.

lrm PATH            -- remove the file PATH on the local machine.
lrm -r PATH         -- remove the directory PATH on the local machine.

vols                -- display the available volumes on the remote peer.

lvols               -- display the available volumes on the local machine.

help COMMAND        -- display help for the specified COMMAND.

config              -- display the current configuration parameters.
config save         -- save the current configuration on the source machine.

open | connect [User@]RemoteHost
                    -- specify the connection information for the remote peer.  "User" is an
                       optional account to use for login.  "RemoteHost" is the host name or IP
                       address of the peer.
                       See https://wanfast.net/site/index.php/support/getting-started for
                       more information.

close | disconnect  -- close connection to remote peer.

maxbw BW            -- set the bandwidth limit on data transfers to BW (mbps).

map LV RV [op]      -- maps the local volume (LV) to the remote volume/path (RV).  LV should
                       either be in DOS drive format, e.g., C:/, or a full path specifying the
                       volume such as /Device/HarddiskVolume2. RV should be in DOS volume format
                       and can include a path to specify the root directory for the replication,
                       e.g., H:/backups/1-12-2019/.  "op" optionally specifies an operation for
                       the volume, values:
                            off   -- No operation.
                            once  -- Do a full block sync and then stop.
                            cont  -- Do a continuous sequence of full block syncs.
                            sync  -- Do a single block sync followed immediately by.
                                    continuous replication.  All changes made during the.
                                    the block sync are queued and replicated after the sync.
                            run   -- Skip the initial sync and start with full replication.

unmap LV            -- unmap the specified local volume, stopping any operation.

list                -- list the local volumes and their status.
list INTERVAL       -- repeatedly list the local volume status every INTERVAL secs.

listall             -- list all the local volume devices and their status.

state | op LV OP    -- specify an operation for a local volume.  "OP" may be one of:
                            off   -- No operation.
                            once  -- Do a full block sync and then stop.
                            cont  -- Do a continuous sequence of full block syncs.
                            sync  -- Do a single block sync followed immediately by.
                                    continuous replication.  All changes made during the.
                                    the block sync are queued and replicated after the sync.
                            run   -- Skip the initial sync and start with full replication.

                        NOTE that you can specify a local volume of "*:" to assign the
                        operation to all mapped volumes.

block | bl LV       -- sync volume LV using wcp block mode

unblock | unbl LV   -- sync volume LV using default wcp file-based mode

run                 -- Start processing any configured operations
run [User@]RemoteHost -- Start processing with specified target.

stop                -- Finish processing all currently active operations. Do not start
                       any new operations.  Stop the replication engine after it has
                       finished any current operations.

abort               -- Immediately stop all operations on the source and target machines.
                       The target volumes may be left in an inconsistent state.

shutdown            -- Immediately stop processing all current operations, close the
                       replication driver and exit the program.

pause               -- Finish processing all currently active operations. Do not start
                       any new operations.  The system state as shown by the SYS command
                       will display 'pausing' until all current operations have
                       completed, at which time the state will change to 'paused'. Do
                       not disconnect the peer until the 'paused' state has been reached.
                       NOTE that as changes will be logged to disk, pausing for too long
                       could exhaust disk space.

snap                -- Perform the next VSS snapshot for data replication and send now

process             -- Force the event processor to flush aggregated commands to the
                       sender.  This command is triggered automatically by 'snap'.

flush               -- flush any file system events in the driver so they can be
                       processed immediately.  Normally events are buffered in the
                       driver so they can be read more efficiently in bulk.  Issuing
                       this command pushes them through the system more quickly.

queues              -- display the status of the event and command queues.

stats               -- display driver statistics.

clear               -- clear the driver statistics.

exit                -- Close this user interface but keep wsyncr running in the background.

set OPTIONS         -- set one or more wsyncr command line options.  Type
                       'set -?' for a list of the available options.

ver                 -- display the current version of the program.

pat                 -- display the current include/exclude lists
pat WHICH           -- display the current include/exclude list where WHICH can be
                       one of:
                            a  - all lists.
                            d  - the driver list.
                            r  - the replication list.
                            s  - the list for any initial volume copy.

vpat VOLUME         -- display the include/exclude list for the specified volume

hold                -- do not update driver configuration after settings change.

update              -- update the driver configuration and clear the hold flag.

vclear VOLUME       -- clear the stats on the specified volume.

vstats VOLUME       -- print the stats for the specified volume.

reseterr VOLUME     -- reset the error flag for the specified volume.

ignore VOLUME       -- ignore any sync errors/warnings for the volume when performing a
                       sync operation and upon completion move to the replication state.
                       NOTE that you can ignore all volumes by leaving VOLUME blank.
noignore VOLUME     -- Turn off the above flag.

system              -- display the current system connection information.

sync                -- Start processing in sync mode -- run sync operations and then move to
                       pause state
sync [User@]RemoteHost -- Start sync mode processing with specified target.
sync                -- If already in sync or run state, bypass the sync wait interval and
                       start any scheduled syncs now.