Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Needed sftware: awscli, jq
  4.  
  5. DATE=$(date +%Y%m%d-%H%M%S)
  6. DB_IDENTIFIER="mysql"
  7. SS=$(aws rds create-db-snapshot --db-snapshot-identifier ${DB_IDENTIFIER}-${DATE} --db-instance-identifier ${DB_IDENTIFIER} | jq -r .DBSnapshot.DBSnapshotArn)
  8.  
  9. DB_STATUS=""
  10. while [[ "$DB_STATUS" != "available" ]]
  11. do
  12. echo -ne "."
  13. sleep 1
  14. DB_STATUS=$(aws rds describe-db-snapshots --db-snapshot-identifier $SS | jq -r ".DBSnapshots[0].Status")
  15. done
  16. echo
  17. echo "DB Snapshot ${SS} is created"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement