diff --git a/states/_runners/process_minion_data.py b/states/_runners/process_minion_data.py index 2761429..42ad0b4 100755 --- a/states/_runners/process_minion_data.py +++ b/states/_runners/process_minion_data.py @@ -34,7 +34,7 @@ def email_errors(fromaddr, toaddrs, subject, data_str, smtp_server): if error or changes: js = subprocess.check_output(["salt-run", "--out=json", "jobs.lookup_jid", data['jid']]) - body = f"JobId is data['jid']\n" + body = "JobId is data['jid']\n" outdata = json.loads(js) nodename = outdata.keys()[0] for i in outdata[nodename]: diff --git a/states/borg/templates/borg_job.sh.j2 b/states/borg/templates/borg_job.sh.j2 index f82faa8..57f8bd1 100644 --- a/states/borg/templates/borg_job.sh.j2 +++ b/states/borg/templates/borg_job.sh.j2 @@ -58,6 +58,9 @@ borg prune \ --keep-weekly {{ job.keep_weekly|default(4) }} \ --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=$? global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit ))