Sun, 06 Aug 2017 18:18:00 +0200
adds some small fixes for 1.0 release
273 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
2 | <html xmlns="http://www.w3.org/1999/xhtml"> | |
3 | <head> | |
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
5 | <meta http-equiv="Content-Style-Type" content="text/css" /> | |
6 | <meta name="generator" content="pandoc" /> | |
283
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
7 | <title>Introduction to dav-sync</title> |
273 | 8 | <style type="text/css">code{white-space: pre;}</style> |
9 | <link rel="stylesheet" href="davdoc.css" type="text/css" /> | |
10 | </head> | |
11 | <body> | |
12 | <div class="header"> | |
285
02d3e4b1245f
adds some small fixes for 1.0 release
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
283
diff
changeset
|
13 | <a href="./index.html"><span>DavUtils documentation</span></a> |
273 | 14 | </div> |
15 | <div class="sidebar"> | |
16 | <div class="nav"> | |
17 | <h3>dav</h3> | |
18 | <ul> | |
19 | <li><a href="getting-started.html">Getting started</a></li> | |
20 | <li><a href="commands.html">Commands</a></li> | |
21 | <ul> | |
22 | <li><a href="list.html">list</a></li> | |
23 | <li><a href="get.html">get</a></li> | |
24 | <li><a href="put.html">put</a></li> | |
25 | <li><a href="mkdir.html">mkdir</a></li> | |
26 | <li><a href="remove.html">remove</a></li> | |
27 | <li><a href="copy.html">copy</a></li> | |
28 | <li><a href="move.html">move</a></li> | |
29 | <li><a href="get-property.html">get-property</a></li> | |
30 | <li><a href="set-property.html">set-property</a></li> | |
31 | <li><a href="lock.html">lock</a></li> | |
32 | <li><a href="unlock.html">unlock</a></li> | |
33 | <li><a href="info.html">info</a></li> | |
34 | <li><a href="date.html">date</a></li> | |
35 | <li><a href="add-repository.html">add-repository</a></li> | |
36 | <li><a href="list-repositories.html">list-repositories</a></li> | |
37 | <li><a href="check-config.html">check-config</a></li> | |
38 | </ul> | |
39 | <li><a href="configuration.html">Configuration</a></li> | |
40 | <li><a href="encryption.html">Encryption</a></li> | |
41 | </ul> | |
42 | </div> | |
43 | <div class="nav"> | |
44 | <h3>dav-sync</h3> | |
45 | <ul> | |
46 | <li><a href="introduction.html">Introduction</a></li> | |
47 | <li><a href="sync-commands.html">Commands</a></li> | |
48 | <ul> | |
49 | <li><a href="pull.html">pull</a></li> | |
50 | <li><a href="push.html">push</a></li> | |
51 | <li><a href="resolve-conflicts.html">resolve-conflicts</a></li> | |
52 | <li><a href="delete-conflicts.html">delete-conflicts</a></li> | |
53 | <li><a href="trash-info.html">trash-info</a></li> | |
54 | <li><a href="empty-trash.html">empty-trash</a></li> | |
55 | <li><a href="add-directory.html">add-directory</a></li> | |
56 | <li><a href="list-directories.html">list-directories</a></li> | |
57 | <li><a href="sync-check-config.html">check-config</a></li> | |
58 | <li><a href="check-repositories.html">check-repositories</a></li> | |
59 | </ul> | |
60 | <li><a href="sync-configuration.html">Configuration</a></li> | |
61 | </ul> | |
62 | </div> | |
63 | </div> | |
64 | ||
65 | <!-- begin content --> | |
66 | <div class="content"> | |
283
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
67 | <div id="header"> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
68 | <h1 class="title">Introduction to dav-sync</h1> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
69 | </div> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
70 | <p>The dav-sync program can synchronize a local directory with a WebDAV collection.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
71 | <h2 id="first-steps">First Steps</h2> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
72 | <p>To use dav-sync it is required to configure a repository in <a href="./configuration.html">config.xml</a> and the directory in <a href="./sync-configuration.html">sync.xml</a>.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
73 | <p>Create a repository with <a href="./add-repository.html">dav add-repository</a>. Unlike <em>dav</em>, <em>dav-sync</em> is not interactive and never shows an authentication prompt. Therefore the user and password <strong>must</strong> be specified if the server requires authentication.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
74 | <pre><code>$ dav add-repository |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
75 | Each repository must have an unique name. |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
76 | name: myfirstrepo |
273 | 77 | |
283
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
78 | Specify the repository base url. |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
79 | url: http://example.com/webdav/ |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
80 | |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
81 | User for HTTP authentication. |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
82 | user (optional): myuser |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
83 | password (optional): </code></pre> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
84 | <p>After the repository is created, configure a sync-directory with <a href="./add-directory.html">dav-sync add-directory</a>.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
85 | <pre><code>$ dav-sync add-directory |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
86 | Each sync directory must have an unique name. |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
87 | name: mysyncdir |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
88 | Enter local directory path. |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
89 | path: $HOME/important_files |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
90 | Specify webdav repository. |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
91 | 0) myfirstrepo |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
92 | 1) anotherrepo |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
93 | repository: 0 |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
94 | Enter collection relative to the repository base url. |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
95 | collection (default: /): /important_files</code></pre> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
96 | <p>The specified name is just an identifier and will be used with other dav-sync commands like <em>pull</em> and <em>push</em>.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
97 | <p>After the configuration is created, you can synchronize your files. There are two commands for it: <em>pull</em> and <em>push</em>.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
98 | <p>With <em>pull</em> you can apply all changes on the server to your local directory. The command scans the server and detects modified files and which files are deleted. All modified files will be downloadet and all deleted files will be locally removed (or moved to the trash directory). The first time you will run <em>pull</em> for a directory this will just download all files from the WebDAV collection.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
99 | <p>You can run the <em>pull</em> command with:</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
100 | <pre><code>dav-sync pull mysyncdir</code></pre> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
101 | <p>The <em>push</em> command scans your local directory for changes, uploads all modified files and removes all locally deleted files from the server.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
102 | <pre><code>dav-sync push mysyncdir</code></pre> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
103 | <h2 id="database">Database</h2> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
104 | <p>Every sync-directory has a database xml file that contains the etag and last modified date of each file. The etag is used to detect changes on the server and the last modified date is used to detect local changes. The database file is usually located in <em>$HOME/.dav/</em> and if you want to reset a sync-directory, you can delete the database. After that, <em>pull</em>/<em>push</em> (with disabled conflict detection) will download/upload all files.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
105 | <h2 id="conflict-detection">Conflict detection</h2> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
106 | <p>The <em>pull</em> and <em>push</em> commands detect if a file has changed remotely and locally. This is a conflict that must be resolved manually.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
107 | <p>When <em>pull</em> detects a conflict it renames the local file to <em>orig-$number.$name</em> where <em>$number</em> is an integer, usually 0 if no other conflict file with the name exists and <em>$name</em> is the file's name. After the file is renamed the new file from the server is downloadet. The user should merge the files manually then or just delete one or keep both. After that run <em>resolve-conflicts</em> to remove all conflict entries from the database otherwise <em>push</em> will ignore any file in a conflict state. There is also the <em>delete-conflicts</em> command that deletes all conflict files.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
108 | <p>When <em>push</em> detects that a file is modified locally and on the server, it just skips this file. Run the <em>pull</em> command to get the new file from the server and resolve the conflict like described above.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
109 | <h2 id="trash">Trash</h2> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
110 | <p>For high data safety, a trash directory can be configured. If this is done, dav-sync will not delete files, but move them to the trash directory. Also the pull command can move files to the trash directory before overwriting them.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
111 | <p>To enable the trash, add the <code><trash></code> element to the directory config. The trash path can be absolute or relative to the sync-directory path.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
112 | <pre><code><directory> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
113 | <name>mydir</name> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
114 | <path>$HOME/myfiles</path> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
115 | <repository>myrepo</repository> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
116 | <database>mydir-db.xml</database> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
117 | |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
118 | <!-- enable trash dir --> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
119 | <trash>.trash</trash> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
120 | </directory></code></pre> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
121 | <p>Files inside the trash directory will not be synchronized with the server.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
122 | <p>Add the <code><backup-on-pull></code> element if you want to backup files to the trash directory before they are overwritten.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
123 | <pre><code><directory> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
124 | ... |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
125 | |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
126 | <backup-on-pull>true</backup-on-pull> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
127 | <directory></code></pre> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
128 | <h2 id="locking">Locking</h2> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
129 | <p>It is highly recommended to lock the repository if it is expected that multiple users want to access and modify the repository simultaneously. Locking can be enabled with the <code>-l</code> option when using the <em>pull</em> or <em>push</em> command, or it can be permanently enabled in <em>sync.xml</em> for a directory with the <code><lock-pull></code> and <code><lock-push></code> elements.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
130 | <pre><code><directory> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
131 | ... |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
132 | <lock-pull>true</lock-pull> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
133 | <lock-push>true</lock-push> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
134 | </directory></code></pre> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
135 | <p>See <a href="./configuration.html">Configuration</a> for details.</p> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
136 | <h2 id="encryption">Encryption</h2> |
0e36bb75a732
adds dav-sync introduction and sync.xml documentation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
273
diff
changeset
|
137 | <p>The <em>dav-sync</em> program uses the same repository settings as <em>dav</em>. If encryption is enabled for a repository, <em>dav-sync</em> stores files encrypted on the server. See <a href="./encryption.html">Encryption</a> for details.</p> |
273 | 138 | </div> |
139 | <!-- end content --> | |
140 | </body> | |
141 | </html> |