Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UCC
rdiff-manager
Commits
071d98cd
Commit
071d98cd
authored
Dec 22, 2011
by
David Adam
Browse files
make output prettier
parent
cdb6c7ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
rdiff-manager.py
View file @
071d98cd
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment