Logging

The "-s" option or the "ShowLogs" option enables logging of syncdat's activities in a machine parseable format.  The output is sent to stdout where it may be redirected to a file or consumed by a parent process.

Error conditions are reported using both MTP/IP numeric codes and human readable text.  See DEI Technical Note 0013 for a description of the numerical codes.

Lines are terminated by the newline character '\n' and each field is delimited by a tab character '\t'.  The first character of each designates the line's type and format:

A Answer to a user Query.
C Comments with routine information.
D Details such as diagnostic and verbose messages.
E Fatal error which will cause syncdat to terminate.
L Local error, usually an error accessing a local file.
P Progress report providing statistics during the SCAN and SYNC phases.
Q Query text that was copied to the user via stderr during interactive operation.
R Remote error, usually an error reported by the server.
S Step number and details for the start of each phase of operation.
V Version information, including the process id.
W Warning about an unusual condition or error which may require user attention.

The second field of each line records the local date and time as "YYYYMMDD HH:MM:SS.mmm".  You can adjust the time zone by setting the TZ environment variable.  For example, running "export TZ=UTC" before running syncdat will switch the logs to UTC time.

Additional fields depend on the type as described below.

Answer

When syncdat is running interactively and requires user input, the query prompt will be written to stderr and a copy of the prompt will be logged as a Query record.  The users's response will be read from stdin and logged as an A record.

A <Time> <Answer>

Comment

Comments are routine details of the syncdat run, formatted for human readability.

C <Time> <Message>

Detail

Debugging and verbose messages provide addtional details the syncdat run and are formatted for human readability.  These are enabled by the "-d" ("Debug") and "-v" ("Verbose") options, though some unusual conditions may be reported even when those options are disabled.

D <Time> <Message>

Error (Fatal)

Fatal error conditions which require syncdat to terminate will be reported at the time they occur.  It is possible for additional log records to occur after the 'E' record, as syncdat shuts down.  However, it is possible that the final status of some pending transactions may not be reported after a fatal error.

E <Time> <Code> <Error Text>

These tab delimited fields are defined as follows:

Code An exit code indicating the type of error.
Error Text  A text description of the error.

Local Error

A failure relating to an individual local file or action.

L <Time> <Operation> <Code> <Message> <Local Path>

These tab delimited fields are defined as follows:

Operation A character indicating the type of operation attempted.
G Getting a file.
L Listing the local folder.
N Creating a local folder.
S Sending a file.
X Deleting a file or folder.
Y Creating a symbolic link.

Code An exit code indicating the type of error.
Message A description of the error.
Path The local path which triggered the error.

Progress

During the SCAN and SYNC steps, syncdat may periodically report progress statistics.  These will occur at intervals of at least one second.  The format depends on which step is being performed.

For the SCAN step:

P SCAN <Time> <Local Items> <Local Bytes> <Remote Items> <Remote Bytes>

These tab delimited fields are defined as follows:

Local Items The number of local files, folders, and other items found so far.
Local Bytes The approximate total size in bytes of the local items found so far.
Remote Items The number of remote files, folders, and other items found so far.
Remote Bytes The approximate total size in bytes of the remote items found so far.

For the SYNC step:

P SYNC <Time> <Action Progress> <Action Total> <Byte Progress> <Byte Total>

These tab delimited fields are defined as follows:

Action Progress The number of actions executed so far.
Action Total The expected number of actions required.
Byte Progress The number of bytes synchronized so far.
Byte Total The expected number of bytes to by synchronized.

Query

When syncdat is running interactively and requires user input, the query prompt will be written to stderr and a copy of the prompt will be logged as a Q record.  The users's response will be read from stdin and logged as an Answer record.

Q <Time> <Prompt>

Remote

A failure relating to an individual remote file or action.

R <Time> <Operation> <Code> <Error Message> <Remote Path>

These tab delimited fields are defined as follows:

Operation A character indicating the type of operation attempted.
G Getting a file.
L Listing the remote folder.
N Creating a remote folder.
S Sending a file.
X Deleting a file or folder.
Y Creating a symbolic link.

Code An exit code indicating the type of error.
Message A description of the error.
Path The remote path which triggered the error.

Step

Details about each step of operation are logged as S records, with a separate format for each.

Step 1: SCAN

S 1 SCAN <Local Path> <Remote Target>

Local Path The path to the local folder being targeted.
Remote Target The remote folder being targeted, formatted as: [user@]host:path

Step 2: COMPARE

S 2 COMPARE <Local Count> <Local Size> <Remote Count> <Remote Size>

Local Count The number of local items being examined.
Local Size The approximate total size in bytes of the local items.
Remote Count The number of remote items being examined.
Remote Size The approximate total size in bytes of the remote items.

Step 3: REPORT or SYNC, depending on whether Safe Mode is in effect.

S 3 REPORT|SYNC <Action Count> <Total Bytes> ...

Action Count Total number of actions to perform
Total Bytes Total number of bytes to be transferred.
Local Ignore Count Number of local items to ignore.
Local Delete Count Number of local items to delete.
Local Delete Size Total size of local items to delete.
Local Overwrite Count Number of local items to replace.
Local Overwrite Size Total size of local items to replace.
Local New Count Number of new local items to create.
Local New Size Total size of local items to create.
Remote Ignore Count Number of remote items to ignore.
Remote Delete Count Number of remote items to delete.
Remote Delete Size Total size of remote items to delete.
Remote Overwrite Count Number of remote items to replace.
Remote Overwrite Size Total size of remote items to replace.
Remote New Count Number of new remote items to create.
Remote New Size Total size of remote items to create.

Version

Information about this syncdat client, its mode of operation, and session ID.

V <Time> syncdat <Version> <Release Date> Peer|Local|Remote <Process ID> <Session ID>

Version The version number of this syncdat client.  For example, 1.7.0.
Release Data The approximate release date for this version
Run Mode Whether we are running in Peer, Local Master, or Remote Master mode.
Process ID The operating system id for this process.
Session ID A unique session identifier for this run.

Warning

Warning messages provide information about unusual conditions or additional commentary about errors.

W <Time> <Message>

Performance

If this output is being piped directly to another application for processing, you must ensure that the target application actually reads it.  In a long transaction or series of transactions it is possible for the quantity of output to exceed the buffer capacity of stdout.  If this happens without the output being read, syncdat will block.