-
Notifications
You must be signed in to change notification settings - Fork 0
/
RunEBSBackup.py
48 lines (30 loc) · 1.26 KB
/
RunEBSBackup.py
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
37
38
39
40
41
42
43
44
45
46
47
48
import datetime
from Class.EBSBackupClass import EBSBackupClass #from Class import *
from Class.EBSConnectClass import EBSConnectClass #from Class import *
if __name__ == "__main__":
import sys
#print len(sys.argv)
if len(sys.argv) < 5:
print "Usage: python RunEBSBackup.py number_of_snapshots_to_keep, description_of_snapshot,"
print "snapshot_search_filter and volumen id list[]"
print "All arguments are required."
sys.exit(1)
print sys.argv
#keep = int(sys.argv[1]) desc = sys.argv[2] snapfilter = sys.argv[3]
#exit()
now = datetime.datetime.now()
#print 'Program Start ' + now.strftime("%Y-%m-%d %H:%M") #now = datetime.datetime.now()
timestamp = now.strftime("%Y%m%d_%H%M%S")
#print timestamp
myEBSConnect = EBSConnectClass()
myec2_conn = myEBSConnect.connect()
#print myec2_conn
#params = [myec2_conn, keep, desc, snapfilter]
#print 'params: ' + str(params)
myEBSBackup = EBSBackupClass()
#print sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]
myEBSBackup.backup_snapshot(myec2_conn, timestamp, sys.argv)
"""
print 'params: ' + str(params)
"""
exit()