Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/destrangis/davbackup

Make backups of a DAV Server
https://github.com/destrangis/davbackup

backup nextcloud owncloud pyhton3 webdav webdav-client

Last synced: about 1 month ago
JSON representation

Make backups of a DAV Server

Awesome Lists containing this project

README

        

DAVBACKUP
=========

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 --destdir

You can use the arguments described above.