Make backups of a DAV Server.
Project description
Downloads an entire tree from a DAV server. This can be used to make backups from an owncloud/nextcloud server.
Usage
The following output of the --help option shows the usage:
$ python3 davbackup.py --help usage: davbackup.py [-h] [--config FILE] [--destdir DIR] [--start RMT_DIR] Download content from DAV server. optional arguments: -h, --help show this help message and exit --config FILE, -c FILE Specify a config file other than the default. --destdir DIR, -d DIR Specify destination directory. --start RMT_DIR, -s RMT_DIR Download only the specified subtree.
Configuration file
A sample configuration file is provided with the name davbackup.json.sample. Rename and edit to suit your needs.
The configuration is a json file whose fields are self explanatory, except perhaps the nbackups field, explained below. Note that the password is base64 encoded. This makes it obscure, not secure, but the program is meant to be run on a trusted machine:
{ "protocol": "https", "server": "nextcloud.samplesite.com", "username": "fred", "password": "YWJyYWNhZGFicmE=", "davstart": "/remote.php/dav/files/fred", "nbackups": 4 }
The field nbackups is the number of backups copy to keep. When the local directory exists already, it is presumed to contain a previous backup, and it is renamed with an extension .001, if a directory with a .001 extension exists, it is renamed to .002 and so on until the specified number of backups is reached. Directories that would have a higher number than the number of backups are simply deleted.
Installing
Use the provided setup.py utility to install:
$ python3 setup.py install
Or simply use pip to install from the the Pypi site:
$ pip install davbackup
Running
Once you have a valid configuration file as described above, just run:
$ davbackup --config <configfile> --destdir <localdir>
You can use the arguments described above.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file davbackup-0.1.4.tar.gz
.
File metadata
- Download URL: davbackup-0.1.4.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdb718db9af6d0dcc404755a51fce9e848cfe4e0cad7b1660e261aa2f187c441 |
|
MD5 | 70920907d411f8f53d3145a6d5fadff3 |
|
BLAKE2b-256 | 59ad028e9a1cb4a1b63e7fd17bf0ee3387e9e7e21a3aab7a194aadc8c4063e90 |