mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 02:34:53 +01:00
bitwarden
This commit is contained in:
@@ -4,6 +4,7 @@ from paho.mqtt import client as mqtt_client
|
|||||||
import getopt
|
import getopt
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@@ -81,6 +82,12 @@ BACKUP_FS = "/srv/dev-disk-by-uuid-2f843500-95b6-43b0-bea1-9b67032989b8"
|
|||||||
if not host in backups:
|
if not host in backups:
|
||||||
print(f"No backup jobs for {host}")
|
print(f"No backup jobs for {host}")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
try:
|
||||||
|
socket.gethostbyaddr("omv.home.lan")
|
||||||
|
except socket.herror:
|
||||||
|
print("Unknown host")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
for b in backups[host]:
|
for b in backups[host]:
|
||||||
topic = "sectorq/omv/backups/{}".format(b.lower())
|
topic = "sectorq/omv/backups/{}".format(b.lower())
|
||||||
if not backups[host][b]["active"]:
|
if not backups[host][b]["active"]:
|
||||||
@@ -168,7 +175,7 @@ for b in backups[host]:
|
|||||||
|
|
||||||
print("Getting size of FS")
|
print("Getting size of FS")
|
||||||
#cmnd = "du -h --max-depth=0 {}".format(BACKUP_FS)
|
#cmnd = "du -h --max-depth=0 {}".format(BACKUP_FS)
|
||||||
cmnd = "df -h /srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee |awk '{ print $3 }'|tail -1"
|
cmnd = "ssh root@omv.home.lan 'df -h /srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee |awk '{ print $3 }'|tail -1'"
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
used_space = (output.split())[0]
|
used_space = (output.split())[0]
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
|
|||||||
Reference in New Issue
Block a user