File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,19 +30,23 @@ function dump {
3030 # --single-transaction: Ensure consistency for InnoDB without locking
3131 # --quick: Stream output to save memory
3232 # --routines: Include stored procedures
33- mariadb-dump -h " $MARIADB_HOST " -u " $MARIADB_USER " -p" $MARIADB_PASSWORD " -P " $MARIADB_PORT " " $MARIADB_DATABASE " \
34- --single-transaction \
35- --quick \
36- --routines \
37- --events \
38- --skip-ssl \
39- --insert-ignore \
40- --verbose
33+ mariadb-dump -h " $MARIADB_HOST " -u " $MARIADB_USER " -p" $MARIADB_PASSWORD " -P " $MARIADB_PORT " \
34+ --single-transaction \
35+ --quick \
36+ --routines \
37+ --events \
38+ --skip-ssl \
39+ --insert-ignore \
40+ --verbose \
41+ " $MARIADB_DATABASE "
4142}
4243
4344function compress {
44- # Use pigz for multi-threaded compression if available, else gzip
45- pigz
45+ if command -v pigz & > /dev/null; then
46+ pigz
47+ else
48+ gzip
49+ fi
4650}
4751
4852function az_upload {
132136 # Stream dump directly to S3 to save disk space
133137 dump | compress | upload
134138 [[ ${PIPESTATUS[0]} != 0 || ${PIPESTATUS[1]} != 0 || ${PIPESTATUS[2]} != 0 ]] && (( ERRORCOUNT += 1 ))
139+ set +x
135140 exit $ERRORCOUNT
136141fi
You can’t perform that action at this time.
0 commit comments