-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeep-freeze-manual.py
More file actions
executable file
·36 lines (31 loc) · 1.31 KB
/
Copy pathdeep-freeze-manual.py
File metadata and controls
executable file
·36 lines (31 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
import argparse
import sys
from backup import Coordinator
from backup.lock import AlreadyRunning
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Runs backups')
parser.add_argument("--cloud-provider",
help="Cloud-provider of the manual backup to trigger",
type=str,
default="aws")
parser.add_argument("--region",
help="Cloud-provider region of the manual backup to trigger",
type=str,
default="eu-north-1")
parser.add_argument("--client-name",
help="Name of the client of the manual backup to trigger",
type=str,
required=True)
parser.add_argument("--backup-root",
help="Root directory of the manual backup to trigger",
type=str,
required=True)
args = parser.parse_args()
print(f"{args}")
c = Coordinator()
try:
c.run_manual(args.cloud_provider, args.region, args.client_name, args.backup_root)
except AlreadyRunning as e:
print(e, file=sys.stderr)
sys.exit(75) # transient error, matches the deep-freeze wrapper's other skip conditions