-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariablessbctl.py
102 lines (100 loc) · 4.1 KB
/
variablessbctl.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import sbctl
from sbctl import *
# mail variables
MysqlOptDef = "--opt --routines"
PortDef = "22"
UserDef = "root"
RsyncOptDef = "-av"
PrivDef = "20"
DirsDef = "/etc,/var"
DirIncDef = "/var/backup"
DirExDef = "/etc/ssh,/var/log"
FrequencyDef = "24"
CleanDateDef = "7"
DBexDef = "information_schema,performance_schema"
# text
tVersion = "Version :"+Version
tStart = "##########################\n"
tServName = "Server name: "
tServIP = "Server IP: "
tUser = "User:"
tServPort = "Server ssh port: "
tPriy = "Priority: "
tOpR = "rsync options: "
tLastD = "Last backup start time: "
tLastDN = "Last backup end time: "
tDirB = "Backup directories"
tDirBx = "Excluded Directories"
tFB = " Backup frequency, hours: "
tCleanB = "Backup server cleaning frequency, days: "
tAOS = "########################## amount of servers "
tHavenot = "no hosts!\nBye "
tCheckInf = "Check information\nName: "
tDir = "Directory :"
tDirEx = "Exclude directory :"
tDataCor = "Are these data correct? yes|no: "
tBye = "\nBye!"
tctrlD = "\nYou pressed Ctrl+C!\nBye!"
tPlease = "Please respond with 'yes' or 'no'"
tAddsshKey = "Add sshkey, please, prepare to enter a password of remote server of its first to connect"
tDuD = "Do you really want to remove this host 'yes' or 'no'? "
tDirBInc = "Mysqldump directory: "
tDoUBackupMysql = "Do you want to backup MySQL? yes|no: "
tResdf = "Result of \"df -h\" on your remote server"
tInstClient = "A client for MySQL backuping has been installed to the remote host, sbcl"
tDoUexdb = "Do you want to exclude any databases? yes|no: "
tUdb = "Your databases: "
tDBex = "Excluded databases: "
tChmy = "Back up MySQL: "
tMyDumpOpt = "Mysqldump options: "
tMysqlLog = "MysqlLog: "
tSbcltext = "Add a job in /etc/crontab, default: [ "
tSbclCron = "0 0 * * * root /usr/sbin/sbcl mysqldump"
tSbcltext2 = " ] You can add other job, format for crontab file : "
tDateStartMysql = "Mysqldump start localtime: "
tDateStopMysql = "Mysqldump stop localtime: "
tMysqlUpdate = "Do you want to reconfiguration mysqldump on the remote host ? ['yes','no' or 'rm' (for remove) ]: "
tNote = """Note that rsync must be installed on your remote server.
If you using mysql backup, please, check that mysqldump is installed and a local configuration file ~/.my.cnf is configured """
tCheckRsync = "Is the Rsync installed on your remote server ? ['yes' or 'no']: "
tPlInR = "Please, install the rsync on your remote server !"
tCheckMy = "Is the file ~/.my.cnf configured ? ['yes' or 'no']: "
tPlconfMy = "Please, configure the ~/.my.cnf for databases access "
tDefMysqlOpt = " you can add --ignore-table=db.table [default: " + \
MysqlOptDef + " ]: "
tdefExDb = "[default: information_schema,performance_schema]: "
tDuDel = "Do you want to purge ['yes' or 'on']: "
Defroot = "[default:" + UserDef + "] "
Defport = "[default: " + str(PortDef) + " ] "
Defop = "[default:" + RsyncOptDef + "] "
Defpri = "[default: " + str(PrivDef) + " ] "
DefFr = "[default: " + str(FrequencyDef) + "] "
DefClean = "[default " + str(CleanDateDef) + "] "
ExampleDir = "example[" + DirsDef + "] "
ExampleDirEx = "example[" + DirExDef + "] "
ExampleIncDir = "example[" + DirIncDef + "] "
ExampleExDB = "example[" + DBexDef + "] "
DefaultNodeName = "[default is your hostname "+SB.Node+"] :"
tStatus = "Status: "
tDelCronResult = "Cron job sbcl has been removed on the remote host"
tAddtoCron = " add to /etc/crontab"
tEndofUpdate = "Configuration has been modified"
tMysqlReady = "Mysqldump ready: "
tMysqlLog = "MysqlLog file: "
tUsestat = "\n\nPlease, use Done/Disabled/needbackup. Examlpe: sbctl statup w1.host.com Done"
tStatdone = "\n\nStatus has been updated"
tUpdateCl = "Start update sbcl : "
tDesc = "Description :"
tDescrm = "Description [rm - for remove description]: "
tNodeName = "Backup node name: "
tNode = "Node :"
tCluster = "Cluster :" + Text_Style(SB.NameCluster)
tNodes = "Hosts of node "
tNodeCount = "number of nodes "
tNodeNot = "Not found"
tNodehostCount = "number of hosts "
tHaveNotNode = "\nYou have not node!\n"
tRmNodeResult = "\nNode has been removed successfully!\n"
tCommandHost = "Command into "
tStatdone_Move_Node = "Node has moved"
tNoteNodeOrServer = "Error: has not node or server"