docs/src/sync-configuration.md

changeset 283
0e36bb75a732
parent 273
c743721d566f
child 320
12ed560c926c
equal deleted inserted replaced
282:3070d72f54af 283:0e36bb75a732
1 ---
2 title: 'Configuration'
3 ---
4
5 The file `$HOME/.dav/sync.xml` is used for configuring sync-directories.
6
7 The *sync.xml* file is an XML file with `<configuration>` as root element. This element can only have `<directory>` elements as children.
8
9 ## directory
10
11 This element configures a sync-directory. A sync-directory must have a unique name, a (local) path, repository and a database.
12
13 Required elements: `<name>`, `<repository>`, `<path>`, `<database>` \
14 Optional elements: `<collection>`, `<trash>`, `<max-retry>`, `<backup-on-pull>`, `<lock-pull>`, `<lock-push>`, `<filter>`
15
16 ### name
17
18 Unique sync-directory identifer. This identifer is used in combination with all *dav-sync* commands.
19
20 Type: string \
21 Example: `<name>mysyncdir</name>`
22
23 ### repository
24
25 Name of the WebDAV-repository. A repository with the same name must be configured in [config.xml][1].
26
27 Type: string \
28 Example: `<name>myrepo</name>`
29
30 ### path
31
32 The path of the local directory that should be synchronized. The path must be an absolute path or start with an environment variable. A path with an environment variable must start with an `$` followed by the variable name optionally followed by a path. For example:
33
34 `<path>$HOME/Documents</path>`
35
36 The part between `$` and `/` is the environment variable name.
37
38 Type: string \
39 Example: `<path>/absolute/path</path>`
40
41 ### database
42
43 Path to the database file used for this sync-directory. The path must be relative to the *$HOME/.dav/* directory.
44
45 Type: string \
46 Example: `<database>myrepo-db.xml</database>`
47
48 ### collection
49
50 Path of the collection relative to the repository root collection. For example if the repository url is *http://example.com/webdav/* and the collection value is */myfiles/*, the directory is synchronized with *http://example.com/webdav/myfiles/*
51
52 Type: string \
53 Default: / \
54 Example: `<collection>/myfiles</collection>`
55
56 ### trash
57
58 Path to the trash directory for this sync-directory. Files that should be deleted will be moved to this directory. The value must be an absolute path or relative to the sync-directory path.
59
60 Type: string \
61 Example: `<trash>.trash</trash>`
62
63 ### max-retry
64
65 This integer value controls how many attempts of downloading/uploading a file in case of an error are made.
66
67 Type: integer \
68 Default: 0 \
69 Example: `<max-retry>3</max-retry>`
70
71 ### backup-on-pull
72
73 If this element has the value of true, the *pull* command will move old local files to the trash directory before downloading the new version from the server.
74
75 Type: boolean \
76 Default: false \
77 Example: `<backup-on-pull>true</backup-on-pull>`
78
79 ### lock-pull
80
81 Enables locking for the *pull* command.
82
83 Type: boolean \
84 Default: false \
85 Example: `<lock-pull>true</lock-pull>`
86
87 ### lock-push
88
89 Enables locking for the *push* command.
90
91 Type: boolean \
92 Default: false \
93 Example: `<lock-push>true</lock-push>`
94
95 ### filter
96
97 With the filter element, include and exclude filters can be specified, to control which files are synchronized. The *pull* and *push* command apply these filters to file paths. At first it is checked if a file is matching any include filter. If so only files matching not an exclude filter are further processed.
98
99 Note: The file path is relative to the directory path (and WebDAV collection) but always starts with an path separator.
100
101 Optional elements: `<include>`, `<exclude>`
102
103 ### include
104
105 Controls which files will be included by *pull* and *push*. If an include filter is specified, only files matching this filter are included.
106
107 Type: regex string \
108 Default: .* \
109 Example:
110
111 <filter>
112 <include>\.pdf$</include>
113 </filter>
114
115 ### exclude
116
117 Controls which files will be excluded by *pull* and *push*.
118
119 Type: regex string \
120 Example:
121
122 <filter>
123 <exclude>^/secretdir</exclude>
124 <exclude>\.DS_Store$</exclude>
125 </filter>
126
127

mercurial