Posts

Showing posts from August, 2014

How to take scheduled back up of AWS RDS snapshots

Amazon provides us with option of Automated backup but if in case you need to take scheduled manual back up than following script can be used..

In the script we are considering the scenario of taking monthly backup on 1st of every month from the daily automated RDS snapshots..

#!/bin/sh # The script to take monthly backup of DB snapshots # By Ravi Gadgil #Following command will find the snapshot identifier from the DB that need to be manually copied.. aws rds describe-db-snapshots --db-instance-identifier DB-server-name1 | grep `date +%Y-%m-01` | grep rds | awk '{ print $8 }' > /tmp/DB-server-name1.txt aws rds describe-db-snapshots --db-instance-identifier DB-server-name2 | grep `date +%Y-%m-01` | grep rds | awk '{ print $8 }' > /tmp/DB-server-name2.txt aws rds describe-db-snapshots --db-instance-identifier DB-server-name3 | grep `date +%Y-%m-01` | grep rds | awk '{ print $8 }' > /tmp/DB-server-name3.txt #Following command will take the snapshot …