Skip to content
Snippets Groups Projects
Commit 071d98cd authored by David Adam's avatar David Adam
Browse files

make output prettier

parent cdb6c7ca
No related merge requests found
...@@ -10,6 +10,7 @@ concurrent_num = 0 ...@@ -10,6 +10,7 @@ concurrent_num = 0
duration_to_keep = '4W' duration_to_keep = '4W'
from multiprocessing import Pool from multiprocessing import Pool
from time import strftime
import subprocess, os, glob import subprocess, os, glob
run_rdiff = lambda *args: subprocess.check_output(('/usr/bin/rdiff-backup',) + args, stderr=subprocess.STDOUT).decode('utf-8') 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__': ...@@ -88,8 +89,26 @@ if __name__ == '__main__':
pool.close() pool.close()
pool.join() pool.join()
for host, r in results.items(): divider = '-' * 76
print("Backup results for", host) # Header
print(r.get()['output']) print(divider)
print('-' * 40) 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() print()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment