mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 02:34:53 +01:00
conf added
This commit is contained in:
@@ -25,14 +25,14 @@ mqtt_username = 'jaydee'
|
||||
mqtt_password = 'jaydee1'
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], "amf", ["command=", "help", "output="])
|
||||
opts, args = getopt.getopt(sys.argv[1:], "amft", ["command=", "help", "output="])
|
||||
except getopt.GetoptError as err:
|
||||
#usage()
|
||||
sys.exit(2)
|
||||
output = None
|
||||
# QJ : getopts
|
||||
_MODE = "manual"
|
||||
_FIRST = False
|
||||
_FIRST = _TEST = False
|
||||
for o, a in opts:
|
||||
if o == "-a":
|
||||
_MODE = "auto"
|
||||
@@ -40,7 +40,8 @@ for o, a in opts:
|
||||
_MODE = "manual"
|
||||
elif o in ("-f", "--first"):
|
||||
_FIRST = True
|
||||
|
||||
elif o in ("-t", "--test"):
|
||||
_TEST = True
|
||||
client = mqtt_client.Client()
|
||||
client.username_pw_set(mqtt_username, mqtt_password)
|
||||
client.connect(broker,1883,60)
|
||||
@@ -120,8 +121,12 @@ for b in backups[host]:
|
||||
|
||||
|
||||
#cmnd = "rsync -av --delete {}/ --link-dest {} --exclude=\".cache\" {}".format(SOURCE_DIR, LATEST_LINK, BACKUP_PATH)
|
||||
|
||||
cmnd = f"rsync -avz --delete {SOURCE_DIR} --link-dest {LATEST_LINK} --exclude=\"gitlab/logs/prometheus\" --exclude=\"home-assistant.log\" --exclude=\"gitlab/logs/*\" --exclude=\"esphome/config/.esphome\" --exclude=\".cache\" --exclude=\".git\" --exclude=\"var_lib_motioneye\" rsync://{BACKUP_HOST}{BACKUP_PATH}"
|
||||
ans = "y"
|
||||
if _TEST:
|
||||
print()
|
||||
ans = input("continue?") or "n"
|
||||
if ans == "y":
|
||||
cmnd = f"rsync -avz --delete {SOURCE_DIR} --link-dest {LATEST_LINK} --exclude=\"gitlab/logs/prometheus\" --exclude=\"home-assistant.log\" --exclude=\"gitlab/logs/*\" --exclude=\"esphome/config/.esphome\" --exclude=\".cache\" --exclude=\".git\" --exclude=\"var_lib_motioneye\" rsync://{BACKUP_HOST}{BACKUP_PATH}"
|
||||
|
||||
# rsync --info=progress2 -avz --delete /share/docker_data/ --link-dest /m-server/docker_data/latest --exclude="gitlab/data/" --exclude="esphome/config/.esphome" --exclude="gitlab/logs/prometheus" --exclude=".cache" --exclude=".git" --exclude="var_lib_motioneye" /m-server/m-server/docker_data/newone1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user