File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ export BM_MYSQL_HOST="localhost"
218
218
# the port where MySQL listen to on the host
219
219
export BM_MYSQL_PORT="3306"
220
220
221
- # which compression format to use? (gzip or bzip2 )
221
+ # which compression format to use? (gzip, bzip2 or zstd )
222
222
export BM_MYSQL_FILETYPE="bzip2"
223
223
224
224
# Extra options to append to mysqldump
@@ -255,7 +255,7 @@ export BM_PGSQL_HOST="localhost"
255
255
# the port where PostgreSQL listen to on the host
256
256
export BM_PGSQL_PORT="5432"
257
257
258
- # which compression format to use? (gzip or bzip2 )
258
+ # which compression format to use? (gzip, bzip2 or zstd )
259
259
export BM_PGSQL_FILETYPE="bzip2"
260
260
261
261
# Extra options to append to pg_dump
Original file line number Diff line number Diff line change @@ -196,6 +196,42 @@ function __exec_meta_command()
196
196
error " Compressor \$ compress is needed."
197
197
fi
198
198
;;
199
+ " zstd" |" zst" )
200
+ if [[ " $compress " = " zstd" ]] ||
201
+ [[ " $compress " = " zst" ]]; then
202
+ compress_bin=$zstd
203
+ if [[ -z " $compress_bin " ]]; then
204
+ error " zstd is not installed but zstd compression needed."
205
+ fi
206
+ ext=" zst"
207
+ fi
208
+ if [[ -n " $compress_bin " ]] && [[ -x " $compress_bin " ]]; then
209
+ debug " $command > $file_to_create 2> $logfile "
210
+ tail_logfile " $logfile "
211
+ if [[ " $BM_ENCRYPTION_METHOD " = " gpg" ]]; then
212
+ warning " Encryption with gpg is not supported with zstd compression at this release."
213
+ else
214
+ $command 2> $logfile | $nice $compress_bin -f -q --rm > $file_to_create .$ext 2> $logfile
215
+ cmdpipestatus=${PIPESTATUS[0]}
216
+ debug " $command 2> $logfile | $nice $compress_bin -f -q --rm > $file_to_create .$ext 2> $logfile "
217
+ file_to_create=" $file_to_create .$ext "
218
+ fi
219
+
220
+ if [[ $? -gt 0 ]]; then
221
+ warning " Unable to exec \$ command; check \$ logfile"
222
+ rm -f $file_to_create
223
+ else
224
+ if [[ $cmdpipestatus -gt 0 ]]; then
225
+ warning " Unable to exec first piped command \$ command; check \$ logfile"
226
+ rm -f $file_to_create
227
+ else
228
+ rm -f $logfile
229
+ fi
230
+ fi
231
+ else
232
+ error " Compressor \$ compress is needed."
233
+ fi
234
+ ;;
199
235
" " |" uncompressed" |" none" )
200
236
if [[ " $verbosedebug " == " true" ]]; then
201
237
tail -f $logfile &
You can’t perform that action at this time.
0 commit comments