github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/mongodb/dataprotection/datafile-backup.sh (about) 1 set -o pipefail 2 export PATH="$PATH:$DP_DATASAFED_BIN_PATH" 3 export DATASAFED_BACKEND_BASE_PATH="$DP_BACKUP_BASE_PATH" 4 trap handle_exit EXIT 5 cd ${DATA_DIR} 6 START_TIME=$(get_current_time) 7 # TODO: flush data and locked write, otherwise data maybe inconsistent 8 # NOTE: if files changed during taring, the exit code will be 1 when it ends. 9 tar -czvf - ./ | datasafed push - "${DP_BACKUP_NAME}.tar.gz" 10 rm -rf mongodb.backup 11 # stat and save the backup information 12 stat_and_save_backup_info $START_TIME