forked from nickbreen/docker-mysql-backup-cron
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
106 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
#!/bin/bash | ||
|
||
case $STORAGE_TYPE in | ||
s3) | ||
if [ -z "$ACCESS_KEY" ] || [ -z "$SECRET_KEY" ] || [ -z "$BUCKET" ]; then | ||
echo "[$STORAGE_TYPE] Cannot access to s3 with the given information" | ||
exit 1 | ||
fi | ||
;; | ||
s3) | ||
if [ -z "$ACCESS_KEY" ] || [ -z "$SECRET_KEY" ] || [ -z "$BUCKET" ]; then | ||
echo "[$STORAGE_TYPE] Cannot access to s3 with the given information" | ||
exit 1 | ||
fi | ||
;; | ||
swift) | ||
if [ -z "$OS_TENANT_NAME" ] || [ -z "$OS_USERNAME" ] || [ -z "$OS_PASSWORD" ] || [ -z "$CONTAINER" ] || [ -z "$OS_AUTH_URL" ]; then | ||
echo "[$STORAGE_TYPE] Cannot access to swift with the given information" | ||
exit 1 | ||
fi | ||
;; | ||
local) | ||
if [ ! -d "$BACKUP_DIR" ]; then | ||
echo "[$STORAGE_TYPE] Cannot backup to the missing directory" | ||
exit 1 | ||
fi | ||
;; | ||
*) | ||
echo "Unknown storage type => $STORAGE_TYPE. s3, swift or local is valid." | ||
exit 1 | ||
;; | ||
if [ -z "$OS_TENANT_NAME" ] || [ -z "$OS_USERNAME" ] || [ -z "$OS_PASSWORD" ] || [ -z "$CONTAINER" ] || [ -z "$OS_AUTH_URL" ]; then | ||
echo "[$STORAGE_TYPE] Cannot access to swift with the given information" | ||
exit 1 | ||
fi | ||
;; | ||
local) | ||
if [ ! -d "$BACKUP_DIR" ]; then | ||
echo "[$STORAGE_TYPE] Cannot backup to the missing directory" | ||
exit 1 | ||
fi | ||
;; | ||
*) | ||
echo "Unknown storage type => $STORAGE_TYPE. s3, swift or local is valid." | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters