You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,12 @@ Ready to use simple example how to [backup SQL Database wtih this script](https:
8
8
To use this image you need to setup all of it's environment values. If one of it's values are missing, empty or of a wrong type, it will print out a message to log to let you know.
9
9
10
10
Environment values meaning:
11
-
- TEST: defaults to False, if set to True doesn't start the scheduler instead waits 30 seconds and runs database dump
11
+
- TEST: defaults to False, if set to True doesn't start the scheduler or server and instead waits 30 seconds and runs database dump
12
12
- CRON: crontab syntax that is used to determine when to backup database, if you're new to crontab or unsure you can use [crontab.guru](crontab.guru) website;
13
+
- START_SERVER: defaults to True, if set to True starts a server which you can access to manually start database dumping
14
+
- SERVER_PORT: default to 33399
15
+
- SERVER_BASIC_AUTH_USER: default to admin; username for server basic auth
16
+
- SERVER_BASIC_AUTH_PASSWORD: default to admin; password for server basic auth
13
17
- DATABASE_TYPE: type of database you want to backup, available values [MySQL, PostgreSQL]
14
18
- DATABASE_HOST: hostname or ip address to database
logger.error("RETURN CODE OF DUMP PROCESS != 0. CHECK OUTPUT ABOVE FOR ERRORS!")
150
-
send_slack_message(environment, "Failed to create DB dump. Please check the error in the container logs.", False)
165
+
send_slack_message(environment, "Failed to create DB dump. Please check the error in the container logs.", 'FAIL')
151
166
else:
152
167
file_size=0
153
168
@@ -171,22 +186,30 @@ def dump_database():
171
186
send_slack_message(environment, f"Successfully created and uploaded DB dump ({sizeof_fmt(file_size)}).")
172
187
exceptExceptionase:
173
188
logger.exception(e)
174
-
send_slack_message(environment, f"Failed to upload DB dump ({sizeof_fmt(file_size)}) to AWS Glacier. Please check the error in the container logs.", False)
189
+
send_slack_message(environment, f"Failed to upload DB dump ({sizeof_fmt(file_size)}) to AWS Glacier. Please check the error in the container logs.", 'FAIL')
175
190
else:
176
191
logger.error(f'Database of type {database_type} is not supported. If you see this message something went horribly wrong.')
0 commit comments