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 src CDATA #REQUIRED>
<!ATTLIST directory dst CDATA #REQUIRED>
<!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'>
]>
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"
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"
/>
...
</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.
"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 '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 '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)
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'.