SHARE
TWEET

Untitled

a guest Oct 18th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top