-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathexec_all.py
More file actions
executable file
·36 lines (29 loc) · 939 Bytes
/
exec_all.py
File metadata and controls
executable file
·36 lines (29 loc) · 939 Bytes
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/python2
import os, sys
from subprocess import check_call
from backupcommon import scriptpath, Configuration
def printhelp():
print "Usage: exec_all.py <action for backup.py> [comma separated exclude list]"
sys.exit(2)
if len(sys.argv) not in [2,3]:
printhelp()
# Directory where the executable script is located
scriptpath = scriptpath()
# Read configuration
configsection = sys.argv[1]
Configuration.init()
if len(sys.argv) == 3:
excludelist = sys.argv[2].split(",")
else:
excludelist = []
excludelist.append('generic')
excludelist.append('rman')
excludelist.append('zfssa')
excludelist.append('autorestore')
excludelist.append('netapp')
# Loop through all sections
for dbname in Configuration.sections():
if dbname not in excludelist:
# Execute backup.py with the specified action
print "--- DATABASE: %s ---" % dbname
check_call([ os.path.join(scriptpath, 'backup.py'), dbname, configsection])