Python wrapper to access and control an UrBackup server
Project description
urbackup-server-web-api-wrapper
Python wrapper to access and control an UrBackup server
Installation
Install with:
pip3 install urbackup-server-web-api-wrapper
Usage
Start a full file backup:
import urbackup_api
server = urbackup_api.urbackup_server("http://127.0.0.1:55414/x", "admin", "foo")
server.start_full_file_backup("testclient0")
List clients with no file backup in the last three days:
import urbackup_api
import time
import datetime
server = urbackup_api.urbackup_server("http://127.0.0.1:55414/x", "admin", "foo")
clients = server.get_status()
diff_time = 3*24*60*60 # 3 days
for client in clients:
if client["lastbackup"]=="-" or client["lastbackup"] < time.time() - diff_time:
if client["lastbackup"]=="-" or client["lastbackup"]==0:
lastbackup = "Never"
else:
lastbackup = datetime.datetime.fromtimestamp(client["lastbackup"]).strftime("%x %X")
print("Last file backup at {lastbackup} of client {clientname} is older than three days".format(
lastbackup=lastbackup, clientname=client["name"] ) )
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for urbackup-server-web-api-wrapper-0.8.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed18bb38defa6bde50d9f442526b28fa4e5e71c44a4148675ec63c614ad4abbd |
|
MD5 | 87e925fe87887deb534cf1c4f1d9268a |
|
BLAKE2b-256 | c7219f15bbf53bcef854a6d836dbb4e9ccc4564aff748c9662ffd9229873d0fe |