diff --git a/rdiff-manager.py b/rdiff-manager.py index fed0b134b24aa3ed8f7816ade88e41d9b148bfe2..1b8fce3a4778d8a7b9725c32fe7c90f693c86249 100755 --- a/rdiff-manager.py +++ b/rdiff-manager.py @@ -10,6 +10,7 @@ concurrent_num = 0 duration_to_keep = '4W' from multiprocessing import Pool +from time import strftime import subprocess, os, glob run_rdiff = lambda *args: subprocess.check_output(('/usr/bin/rdiff-backup',) + args, stderr=subprocess.STDOUT).decode('utf-8') @@ -88,8 +89,26 @@ if __name__ == '__main__': pool.close() pool.join() - for host, r in results.items(): - print("Backup results for", host) - print(r.get()['output']) - print('-' * 40) + divider = '-' * 76 + # Header + print(divider) + print('RDIFF-MANAGER REPORT for run started', strftime('%c')) + print(divider) + + # Summary + print() + print('SUMMARY:') + print() + for k, v in results.items(): + if v.get()['success']: + print(' Backup succeeded for', k) + else: + print(' Backup FAILED for', k) + print() + + for k, v in results.items(): + print(divider) + print("Backup results for", k) + print() + print(v.get()['output']) print()