Synchronize can be configured via a XML config file. You can write this config file by hand - or use the GUI to create one. The program expects the path to this config file as an attribute when it is started. The config file starts with a XML prolog:
<?xml version="1.0" encoding="UTF-8"?>
Now follows the DTD (a DocumentTypeDefinition defines how a XML file should look; which elements and which attributes can be used. It has nothing to do with the configuration of Synchronize; it defines how a valid config file for Synchronize has to be defined):
<!DOCTYPE dirsync [ <!ELEMENT dirsync (directory*)> <!ATTLIST dirsync logfile CDATA ''> <!ATTLIST dirsync timestampwriteback (true|false) 'false'> <!ATTLIST dirsync timestampdiff CDATA '0'> <!ATTLIST dirsync skiplinks (true|false) 'false'> <!ELEMENT directory EMPTY> <!ATTLIST directory name CDATA #REQUIRED> <!ATTLIST directory enable (true|false) 'true'> <!ATTLIST directory src CDATA #REQUIRED> <!ATTLIST directory dst CDATA #REQUIRED> <!ATTLIST directory SyncMode CDATA #REQUIRED> <!ATTLIST directory SameAsDefault (true|false) 'true'> <!ATTLIST directory withsubfolders (true|false) 'false'> <!ATTLIST directory verify (true|false) 'false'> <!ATTLIST directory include CDATA ''> <!ATTLIST directory exclude CDATA ''> <!ATTLIST directory dirinclude CDATA ''> <!ATTLIST directory direxclude CDATA ''> <!ATTLIST directory logfile CDATA ''> <!ATTLIST directory copyall (true|false) 'false'> <!ATTLIST directory copylarger (true|false) 'false'> <!ATTLIST directory copymodified (true|false) 'false'> <!ATTLIST directory copylargermodified (true|false) 'false'> <!ATTLIST directory copynew (true|false) 'false'> <!ATTLIST directory delfiles (true|false) 'false'> <!ATTLIST directory deldirs (true|false) 'false'> <!ATTLIST directory delexcludedfiles (true|false) 'false'> <!ATTLIST directory delexcludeddirs (true|false) 'false'> <!ATTLIST directory bidirsyncconflictmode CDATA ''> <!ATTLIST directory backups CDATA ''> <!ATTLIST directory backupinline (true|false) 'false'> <!ATTLIST directory backupdir CDATA ''> ]>
As you can see from the DTD now follows one <synchronize> element containing none, one or more <directory> elements:
<synchronize logfile="D:\Desktop\work\global.log" timestampwriteback="false" timestampdiff='0' skiplinks="false" > <directory name="Dokumentation" src="L:\Desktop\Dateien\- Dokumentation" dst="D:\Desktop\Dateien\- Dokumentation" SyncMode="Bidirectional" SameAsDefault="true" withsubfolders="true" verify="false" include="*" exclude="" dirinclude="*" direxclude="" logfile="D:\Desktop\Dateien\getDokumentation.log" copyall="false" copynew="true" copylarger="true" copymodified="true" copylargermodified="false" delfiles="false" deldirs="false" backups="0" /> ... </synchronize>
The 'logfile'-attribute:
A
valid attribute value is a path to a file or an empty value ("").
If you want logging, you must specify a logfile. The path must
be given absolut, the directory must exist. The file doesn't have to
exist yet, it will be created. If the file already exists the log
will overwrite the file.
This attribute is optional, if you
don't specify a log file, logging will be disabled.
"timestampfix":
Workaround for the problem that some filesystems don't store
timestamps accurately.
Some filesystems don't store timestamps
accurately (e.g. FAT) and it is possible that problems with
the option "Copy modified" arise (e.g. FAT always
forces the timestamp down to even seconds; if you copy a file with a
source timestamp of "12:05:01" to FAT it will be stored
with a destination timestamp of "12:05:00". The next time
you synchronize this file with the "Copy modified" option
it will be copied again because the source
timestamp is newer than the destination timestamp).
If
this option is set to "true" then after a file has been
copied the destination timestamp is written back to the source file
(the timestamp of "12:05:00" would be written back to
the source file. The next time you synchronize this file with the
"Copy modified" option it will not be
copied again because both files have the same timestamp).
This
doesn't work if the source file is write protected.
This
attribute is optional, if the attribute isn't specified the
destination timestamp will no be written back to the source file.
"timestampdiff":
If this value is set then timestamps that differ x
seconds are treated as equal (the timestamp of "12:05:00"
would be treated as equal to the timestamp "12:05:01". If
you synchronize this file with the "Modified" option it
will not be copied because both files have
an equal timestamp).
If this value is chosen too big
files that are actually different might be falsely considered to be
identical.
"skiplinks": Skips symbolic
links while copying; otherwise symbolic links are copied as
files.
If you already copied symbolic links and select this
option later the symbolic links that have been copied to the target
directories as files will be deleted in the target directories.
Only
applies if the source filesystem can handle symbolic links (UNIX,
Linux, MacOS).
This attribute is optional, if the attribute isn't
specified symbolic links will be copied as files.
Now we can start with the single directories:
The 'name'-attribute:
A
valid attribute value is any String.
A name for this directory
synchronization. The name is only used for displaying purposes, but
must be specified.
The 'enable'-attribute:
Valid attribute values are 'true' or 'false'.
Is enables or not the directory synchronisation.
The 'src'-attribute:
A
valid attribute value is the path to an existing directory.
With
this attribute you define the path of the source directory to
synchronize to a destination directory. Here you specify the
directory with the original files.
The 'dst'-attribute:
A
valid attribute value is the path to an existing directory.
Here
you specify the destination directory where to store the
backup-files.
See section "GUI" for wildcards you can
specify.
The 'SyncMode'-attribute:
Valid
values are: “A to B”, “B to A”,
“Bidirectional”.
If set to “A to B” the
content of the directory B is synchonized according to the content
of the directory A;
If set to “B to A” the content of
the directory A is synchonized according to the content of the
directory B;
If set to “ Bidirectional” the content
of both directories get synchronized with each other.
The 'SameAsDefault'-attribute:
Valid
values are: true, false
This attribute sets if the directory
options are same as the default settings.
The 'include'-attribute:
A
valid attribute value is any string of file patterns separated by
semicolons.
Here you can decide if only files matching a
specified file pattern should be synchronized.
For example if
you set '*.txt' only files that end with '.txt' will be
processed.
You can use wildcards (i.e. '?' and '*'). '?' means
zero, or one character, '*' means zero, one, or more characters.
You can specifiy more than one file pattern seperated by
semicolons ';'.
This attribute is optional, if the attribute
isn't specified all files will be processed.
The 'exclude'-attribute:
A
valid attribute value is any string of file patterns separated by
semicolons.
Here you can decide if files matching a specified
file pattern should NOT be synchronized.
For example if you set
'*.txt' only files that do NOT end with '.txt' will be
processed.
You can use wildcards (i.e. '?' and '*'). '?' means
zero, or one character, '*' means zero, one, or more characters.
You can specifiy more than one file pattern seperated by
semicolons ';'.
This attribute is optional, if the attribute
isn't specified all files will be processed.
The 'dirinclude'-attribute:
A valid attribute value is any string of file patterns separated
by semicolons.
Here you can decide if only files matching a
specified file pattern should be synchronized.
For example if
you set '*.txt' only files that end with '.txt' will be
processed.
You can use wildcards (i.e. '?' and '*'). '?' means
zero, or one character, '*' means zero, one, or more characters.
You can specifiy more than one file pattern seperated by
semicolons ';'.
This attribute is optional, if the attribute
isn't specified all files will be processed.
The 'direxclude'-attribute:
A valid attribute value is any string of file patterns separated
by semicolons.
Here you can decide if files matching a specified
file pattern should NOT be synchronized.
For example if you set
'*.txt' only files that do NOT end with '.txt' will be
processed.
You can use wildcards (i.e. '?' and '*'). '?' means
zero, or one character, '*' means zero, one, or more characters.
You can specifiy more than one file pattern seperated by
semicolons ';'.
This attribute is optional, if the attribute
isn't specified all files will be processed.
The 'logfile'-attribute:
A
valid attribute value is a valid path to a file or an empty value
("").
If you want logging for this directory, you must
specify a logfile. The path must be given absolute. The directory
and file don't have to exist, they will be created. If the file
already exists the log will overwrite the file. If you don't specify
a log file, logging for this directory will be disabled.
See
section "GUI" for wildcards you can specify.
The 'copyall'-attribute:
Valid attribute values are 'true' or 'false'.
If a file already exists in the destination directory 'dst'
it will always be overwritten with that one from the source
directory 'src'.
If you set 'copyall' to
'true', all other copy options will be ignored (you already
copied all files, what do you want more?)
The 'copynew'-attribute:
Valid attribute values are 'true' or 'false'.
Files that exist in the source directory 'src' but not
in the destination directory 'dst' will be copied to the
destination directory 'dst'.
The 'copylarger'-attribute:
Valid attribute values are 'true' or 'false'.
If there already is a file with the same name in the destination
directory 'dst', it will only be overwritten with the file
from the source directory 'src' if its size is smaller than
the size of the original file in the source directory 'src'.
The 'copymodified'-attribute:
Valid attribute values are 'true' or 'false'.
If there already is a file with the same name in the destination
directory 'dst', it will only be overwritten with the file
from the source directory 'src' if its modified-date is
older than the modified-date of the original file in the source
directory 'src'.
The 'copylargermodified'-attribute:
Valid attribute values are 'true' or 'false'.
If there already is a file with the same name in the destination
directory 'dst', it will only be overwritten with the file
from the source directory 'src' if its size is smaller and
its modified-date is older than the size and date of the original
file in the source directory 'src'.
If you set
'copylarger' or 'copymodified' to 'true',
'copylargermodified' will be ignored (you already copied these
files)
"With subfolders":
Includes subfolders in this synchronization.
Here you can decide
whether you want to synchronize the content of the source directory
including subfolders or not.
This attribute is optional, if the
attribute isn't specified no subfolders will be synchronized.
"Verify": Verify
copied files.
If this box is checked then after a file has been
copied checksums of the source and destination file are calculated
and compared. If the checksums don't match an "Verify error"
will be reported.
This attribute is optional, if the attribute
isn't specified no verification will be done.
The 'delfiles'-attribute:
Valid attribute values are 'true' or 'false'.
Files that have been deleted in the source directory 'src',
but still exist in the destination directory 'dst' will be
deleted in the destination directory 'dst' if this
attribute is set to 'true'.
The 'deldirs'-attribute:
Valid attribute values are 'true' or 'false'.
Directories that have been deleted in the source directory
'src', but still exist in the destination directory 'dst'
will be deleted in the destination directory 'dst' if this
attribute is set to 'true'.
The 'delexcludedfiles'-attribute:
Valid attribute values are 'true' or 'false'.
Files that match the excluded files pattern will be deleted in
the destination directory 'dst' if this attribute is set to
'true'.
The 'delexcludeddirs'-attribute:
Valid attribute values are 'true' or 'false'.
Directories that match the excluded files pattern will be
deleted in the destination directory 'dst' if this
attribute is set to 'true'.
The 'backup'-attribute:
Valid attribute values are '0' up to the maximum number
of backups (currently '50').
Before a file in the
destination directory 'dst' will be overwriten or deleted
the file is copied to a special subdirectory of the destination
directory as a backup.
The 'backupinline'-attribute:
Valid attribute values are 'true' or 'false'.
If this attribute is set to 'false'
the backup directory is created within the destination directory.
If
this attribute is set to 'true'
an alternative backup directory could be specified using the
following attribute.
The 'backupdir'-attribute:
A valid attribute value is a valid path to a file or an empty
value ("").
With this attribute you define the path of
the alternative backup directory in which the backup files are
created.