Last active
March 29, 2017 06:54
-
-
Save romainnorberg/0a48de7ff6ce9af414ee3049a354a907 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
# source environment variables | |
# https://www.clever-cloud.com/doc/admin-console/environment-variables/ | |
source /home/bas/applicationrc | |
if [ -n ${INSTANCE_TYPE} ] && [ ${INSTANCE_TYPE} = 'production' ] && [ -n ${INSTANCE_NUMBER} ] && [ ${INSTANCE_NUMBER} -eq 0 ] | |
then | |
DATE=`date +%Y%m%d-%H%M%S` | |
#... | |
mysqldump -u${MYSQL_SERENE_FORTRABBIT_USER} -h${MYSQL_SERENE_FORTRABBIT_HOST} -p${MYSQL_SERENE_FORTRABBIT_PASSWORD} --all-databases > ${APP_HOME}/buckets/backups/$DATE.sql | |
# zip file(s) with a specific password | |
zip -P ${BACKUP_PASSWORD} ${APP_HOME}/buckets/backups/$DATE.zip ${APP_HOME}/buckets/backups/$DATE.sql | |
rm ${APP_HOME}/buckets/backups/$DATE.sql | |
echo "backups done" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment