Arguments:

<mmsync_dev>

The device object to use in synchronizations.
You must specify the same device used by the mm-sync service you started earlier.
The default device is /dev/mm-sync, but if you overrode this when starting mm-sync,
the device specified here must match.

Description:

The mmsyncclient utility allows you to perform synchronizations and monitor their progress through the command line.
When you start a synchronization, mmsyncclient displays an operation ID (op_id), which
you can use to pause, resume, or cancel the synchronization or to check its progress at a later time.
With the sync_debug_set command, you can control how much activity and debugging information is logged, which is useful for troubleshooting.

Commands:

sync_start

Start a synchronization of the media content within the specified path on the mediastore that is accessible
at the specified mountpoint. The media content is synchronized to the database identified by the device path.

The device path of the database where the content is to be synchronized.

<mountpoint>

The mountpoint of the mediastore to synchronize.

<syncpath>

The relative path of the file or folder to synchronize.

<options>

The synchronization options (MMSYNC_OPTION_*).
You may use one or many of these options to control which synchronization passes get done,
whether subfolders are recursively synchronized, and when folder information is updated to reflect the current mediastore files and playlists.

<extended_options>

(Optional) A set of key/value pairs with extended synchronization options, formatted as a comma-separated list of pairs:

Force the use of the requested synchronizer, whether or not it supports the current operation.

dynamic_folder

enable | disable

Enable or disable the dynamic setting for the folder specified in syncpath. The fids for files in this
folder will remain constant while this setting is enabled. The setting is nonrecursive, so the only files affected are those in the top-level folder
given in syncpath; files in subfolders aren't affected.

A set of key/value pairs with synchronization control commands, formatted as a comma-separated list of pairs:

key1=value1,key2=value2,key3=value3,...

Key

Value

Description

action

Currently, only one action is supported: priority_folder_set

The action to perform on the synchronization.

folderid

An integer storing the ID of a mediastore folder.

The folder the action is performed on. Either this field or folder_path must be defined for actions
such as priority_folder_set that affect a particular folder.

folder_path

A string storing the path of a mediastore folder.
The path is relative to the mediastore's filesystem (e.g., "/" refers to the mediastore's root folder).

The folder the action is performed on. Either this field or folderid must be defined for actions
such as priority_folder_set that affect a particular folder.

dynamic_folder

enable | disable

Enable or disable the dynamic setting for the folder referred to by either folderid or folder_path.
This option applies to the priority_folder_set action.

When this setting is enabled, the fids for files in this folder will remain constant.
The setting is nonrecursive, so the only files affected are those in the top-level folder in the synchronization path named in the operation
<op_id>; files in subfolders aren't affected.

Initiates a priority folder synchronization.
Requires one of the folderid and folder_path key/value pairs.
You can also define the dynamic_folder key to enable or disable the dynamic folder setting.

flags

(Optional) Must be 0; reserved for future use

Returns:

With the sync_start command, when the synchronization starts successfully,
mmsyncclient returns a text string with the operation ID, which allows you to monitor and control the synchronization in follow-up commands.
When the synchronization does not start successfully, a text string with a failure message and a return code of -1 is returned.

All other commands return at a minimum a text string with the return code (rc) and error number (errno).
A return code of 0 means the operation completed successfully and is accompanied by an error number of 0.
A nonzero return code (typically, -1) means an error occurred.
See errno for which error it was and sloginfo for details about the error.

The commands that get synchronization status will return information on the progress of one or many synchronizations, when those commands complete successfully.
With the sync_status_get_byid and sync_status_get_bydbname commands, mmsyncclient returns
a text string with the following information:

<op_id>, the operation ID of the synchronization

Completed, flags indicating the synchronization passes that have been
completed

Current, flag indicating which synchronization pass, if any, is in progress

Pending, flags indicating the synchronization passes that have not yet been started

When either of these two commands fails, mmsyncclient returns a text string with the operation ID or database name for the synchronization
whose status could not be attained, along with an error string and number.
If you provide an operation ID or a database name that doesn't refer to any active synchronization, the standard message containing the return code and error number is
returned, with both fields set to 0 because no error actually occurred.

The sync_status_get command produces similar output except that when
successful, the status of not just one but all active synchronizations is displayed,
and the return code is the number of synchronizations in progress or pending. If
this command fails, the return code and error number are returned, with
rc being nonzero and errno set based on
the error that occurred.

With sync_status_get_dbname, if the operation ID refers to an active synchronization,
mmsyncclient returns a text string naming the database being used in the specified synchronization.
Otherwise, the standard message containing the return code and error number is returned.
If there's no active synchronization with the given operation ID, the return code is 0, because no error actually occurred.
If the command fails, the return code is nonzero and errno is set based on the error that occurred.