Python wrapper to access and control an UrBackup server
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Test stopping all running file backups Aug 14, 2017
urbackup_api Merge branch 'master' of… Aug 14, 2017
.gitignore Initial commit Aug 21, 2016
LICENSE Initial commit Aug 21, 2016
setup.cfg Incremented version Aug 14, 2017


Python wrapper to access and control an UrBackup server


Install with:

pip3 install urbackup-server-web-api-wrapper


Start a full file backup:

import urbackup_api

server = urbackup_api.urbackup_server("", "admin", "foo")


List clients with no file backup in the last three days:

import urbackup_api
import time
import datetime
server = urbackup_api.urbackup_server("", "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"
            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"] ) )