Skip to content

Commit

Permalink
Update dump.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ricristian authored May 27, 2023
1 parent 3d553d7 commit 245728a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ if test -n "${ONLY_TABLE-}"; then
mysqldump -h "$DB_HOST" -u $DB_USER -p"$DB_PASS" $DB_NAME $TBLIST --verbose > $DB_BACKUP_PATH/$DB_NAME-$CURRENT_DATE.sql
elif [[ "${IGNORE_TABLES}" ]]; then
echo "🚧 Ignoring table $IGNORE_TABLES"
mysqldump -h "$DB_HOST" -u $DB_USER -p"$DB_PASS" $DB_NAME $IGNORE --verbose | gzip -9 > $DB_BACKUP_PATH/$DB_NAME-$CURRENT_DATE-2.sql.gz
mysqldump -h "$DB_HOST" -u $DB_USER -p"$DB_PASS" $DB_NAME $IGNORE --verbose | gzip > $DB_BACKUP_PATH/$DB_NAME-$CURRENT_DATE-2.sql.gz
echo "🚧 Uploading mysql dump ($DB_NAME-$CURRENT_DATE.sql.gz) to s3 ..."
aws s3 --endpoint=https://$S3_URL cp $DB_BACKUP_PATH/$DB_NAME-$CURRENT_DATE-2.sql.gz s3://${S3_BUCKET}/db/
else
echo "✅Creating backup for entire database"
mysqldump -h "$DB_HOST" -u $DB_USER -p"$DB_PASS" $DB_NAME --verbose | gzip -9 > $DB_BACKUP_PATH/$DB_NAME-$CURRENT_DATE-90.sql.gz
mysqldump -h "$DB_HOST" -u $DB_USER -p"$DB_PASS" $DB_NAME --verbose | gzip > $DB_BACKUP_PATH/$DB_NAME-$CURRENT_DATE-90.sql.gz
echo "🚧 Uploading mysql dump ($DB_NAME-$CURRENT_DATE.sql.gz) to s3 ..."
aws s3 --endpoint=https://$S3_URL cp $DB_BACKUP_PATH/$DB_NAME-$CURRENT_DATE-90.sql.gz s3://${S3_BUCKET}/db/
fi
Expand Down

0 comments on commit 245728a

Please sign in to comment.