File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
install/etc/s6/services/10-db-backup Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 6565 "mysql" | "MYSQL" | "mariadb" | "MARIADB")
6666 DBTYPE=mysql
6767 DBPORT=${DB_PORT:-3306}
68- [[ ( -n "${DB_PASS}" ) ]] && MYSQL_PASS_STR=" -p' ${DBPASS}'"
68+ [[ ( -n "${DB_PASS}" ) ]] && export MYSQL_PWD= ${DBPASS}
6969 ;;
7070 "postgres" | "postgresql" | "pgsql" | "POSTGRES" | "POSTGRESQL" | "PGSQL" )
7171 DBTYPE=pgsql
@@ -96,20 +96,20 @@ function backup_couch() {
9696
9797function backup_mysql() {
9898 if [ "$SPLIT_DB" = "TRUE" ] || [ "$SPLIT_DB" = "true" ]; then
99- DATABASES=`mysql -h ${DBHOST} -P $DBPORT -u$DBUSER -p"${DBPASS}" - -batch -e "SHOW DATABASES;" | grep -v Database|grep -v schema`
99+ DATABASES=`mysql -h ${DBHOST} -P $DBPORT -u$DBUSER --batch -e "SHOW DATABASES;" | grep -v Database|grep -v schema`
100100
101101 for db in $DATABASES; do
102102 if [[ "$db" != "information_schema" ]] && [[ "$db" != _* ]] ; then
103103 echo "** [db-backup] Dumping database: $db"
104104 TARGET=mysql_${db}_${DBHOST}_${now}.sql
105- mysqldump --max-allowed-packet=512M -h $DBHOST -P $DBPORT -u$DBUSER ${MYSQL_PASS_STR} --databases $db > ${TMPDIR}/${TARGET}
105+ mysqldump --max-allowed-packet=512M -h $DBHOST -P $DBPORT -u$DBUSER --databases $db > ${TMPDIR}/${TARGET}
106106 generate_md5
107107 compression
108108 move_backup
109109 fi
110110 done
111111 else
112- mysqldump --max-allowed-packet=512M -A -h $DBHOST -P $DBPORT -u$DBUSER ${MYSQL_PASS_STR} > ${TMPDIR}/${TARGET}
112+ mysqldump --max-allowed-packet=512M -A -h $DBHOST -P $DBPORT -u$DBUSER > ${TMPDIR}/${TARGET}
113113 generate_md5
114114 compression
115115 move_backup
You can’t perform that action at this time.
0 commit comments