1 ---
2 title: 'dav-sync add-directory'
3 ---
4
5 This command runs an interactive assistant that creates a [sync-directory configuration][1] and adds it to the sync.xml file.
6 Before running this command, a repository must be created. See [dav add-repository][2].
7
8 [1]: ./sync-configuration.html
9 [2]: ./add-repository.html
10
11 **Command alias:** add-dir
12
13 The assistant firstly asks for a unique sync-directory name.
14 This may not match the physical directory name.
15 If you are not sure, which names are already in use, you can get a list of currently present sync-directories with [dav-sync list-directories][3].
16 Then you specifiy the local path, select the dav repository and specify the collection within that repository.
17 You may use environment variables like `$HOME` within the path name.
18 A call of `add-directory` may look like this.
19
20 $ dav-sync add-directory
21 Each sync directory must have an unique name.
22 name: mysyncdir
23 Enter local directory path.
24 path: $HOME/important_files
25 Specify webdav repository.
26 0) myfirstrepo
27 1) anotherrepo
28 repository: 0
29 Enter collection relative to the repository base url.
30 collection (default: /): /important_files
31
32 Assume `myfirstrepo` points to `https://mynas.local/webdav`.
33 Then `dav-sync` would synchronize `$HOME/important_files/` with `https://mynas.local/webdav/important_files`.
34
35
36 [3]: ./list-directories.html
37
38