Compare commits
2 commits
7d75088cbd
...
0ab3c5413b
Author | SHA1 | Date | |
---|---|---|---|
0ab3c5413b | |||
143f9a5b63 |
2 changed files with 46 additions and 0 deletions
46
README.md
Normal file
46
README.md
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
# WebDAV CLI
|
||||||
|
|
||||||
|
Can be used to pull a directory from a remote WebDAV server, e.g. as supported by Nextcloud.
|
||||||
|
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Python >3.6
|
||||||
|
- Pip
|
||||||
|
|
||||||
|
## Quickstart (using poetry)
|
||||||
|
|
||||||
|
```
|
||||||
|
pip3 install poetry
|
||||||
|
git clone <repo-url>
|
||||||
|
cd <local-repo-path>
|
||||||
|
local-repo-path $ git submodule init && git submodule update
|
||||||
|
local-repo-path $ poetry install
|
||||||
|
local-repo-path $ poetry run python webdavcli/webdavcli.py -h
|
||||||
|
Using python3.7 (3.7.6)
|
||||||
|
usage: webdavcli.py [-h] remote_dir local_dir
|
||||||
|
|
||||||
|
Pulls a WebDAV remote directory.
|
||||||
|
|
||||||
|
positional arguments:
|
||||||
|
remote_dir remote source path
|
||||||
|
local_dir local target path
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
To use the client, create a file `.env` in the `local-repo-path` with the following content (adapt it according to your environment):
|
||||||
|
|
||||||
|
```
|
||||||
|
WEBDAV_SYNC_REMOTE_URL="https://nextcloud.example.tld/remote.php/dav/files/<username>/"
|
||||||
|
WEBDAV_SYNC_REMOTE_USER="<username>"
|
||||||
|
WEBDAV_SYNC_REMOTE_PASS="<password>"
|
||||||
|
```
|
||||||
|
|
||||||
|
Ensure that the remote WebDAV directory exists and then run the client, supplying a remote directory and a local target directory:
|
||||||
|
|
||||||
|
```
|
||||||
|
poetry run python webdavcli/webdavcli.py <remote_dir> <local_dir>
|
||||||
|
```
|
Loading…
Add table
Reference in a new issue