Last active
July 27, 2024 17:31
-
-
Save alanfzf/2c7622719548c104c8145ec00eea468e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# System variables | |
PROFILE=finanssoreal | |
BUCKET=s3://finanssoreal/database/ | |
OBJECT="$(aws s3 ls --profile $PROFILE $BUCKET | sort | tail -n 1 | awk '{print $4}')" | |
FULL_PATH="$HOME/$OBJECT" | |
aws s3 cp "$BUCKET$OBJECT" "$FULL_PATH" --profile $PROFILE | |
gunzip $FULL_PATH | |
if [[ "$1" == "-fixsql" ]]; then | |
FULL_PATH="${FULL_PATH%.gz}" | |
sed -i 's/DEFINER=`forge`@`%`/DEFINER=`root`@`%`/g' $FULL_PATH | |
fi | |
echo "Dump descargado correctamente en $FULL_PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment