updated borg state

This commit is contained in:
Paul 2021-09-25 16:08:25 +02:00
parent a9f6bc4f94
commit 7efc411963
2 changed files with 4 additions and 1 deletions

View File

@ -34,7 +34,7 @@ def email_errors(fromaddr, toaddrs, subject, data_str, smtp_server):
if error or changes: if error or changes:
js = subprocess.check_output(["salt-run", "--out=json", js = subprocess.check_output(["salt-run", "--out=json",
"jobs.lookup_jid", data['jid']]) "jobs.lookup_jid", data['jid']])
body = f"JobId is data['jid']\n" body = "JobId is data['jid']\n"
outdata = json.loads(js) outdata = json.loads(js)
nodename = outdata.keys()[0] nodename = outdata.keys()[0]
for i in outdata[nodename]: for i in outdata[nodename]:

View File

@ -58,6 +58,9 @@ borg prune \
--keep-weekly {{ job.keep_weekly|default(4) }} \ --keep-weekly {{ job.keep_weekly|default(4) }} \
--keep-monthly {{ job.keep_monthly|default(6) }} \ --keep-monthly {{ job.keep_monthly|default(6) }} \
info "Cleaning up logs"
find {{ working_dir }}/logs/${backup_name}-*.log -mtime +{{ job.keep_logs_days|default(7) }} -delete
prune_exit=$? prune_exit=$?
global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit )) global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit ))