Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Needed sftware: awscli, jq
- DATE=$(date +%Y%m%d-%H%M%S)
- DB_IDENTIFIER="mysql"
- SS=$(aws rds create-db-snapshot --db-snapshot-identifier ${DB_IDENTIFIER}-${DATE} --db-instance-identifier ${DB_IDENTIFIER} | jq -r .DBSnapshot.DBSnapshotArn)
- DB_STATUS=""
- while [[ "$DB_STATUS" != "available" ]]
- do
- echo -ne "."
- sleep 1
- DB_STATUS=$(aws rds describe-db-snapshots --db-snapshot-identifier $SS | jq -r ".DBSnapshots[0].Status")
- done
- echo
- echo "DB Snapshot ${SS} is created"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement