Skip to content

Python Boto script to delete rds snapshots older than X days

Notifications You must be signed in to change notification settings

amjad489/delete_rds_snapshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

AWS RDS BOTO Script to Delete Snapshots

A python script which uses BOTO SDK to delete rds snapshots older than X days

Dependencies

boto.rds2

Features available in the script

This script you can use it to list all the snapshots which can be deleted. As well as you can use it to delete those snapshots. This script can easily be use to automate the RDS snapshot cleanup process. To Automate you just have to schedule it under cron job in Linux or on windows you can schedule from Task Scheduler

#How to run the script Following is the snippet on how to run the script to get the list of available snapshots to be deleted

python delete_rds_snapshot.py us-east-1 db-master-1 7 list

Below snippet on how to run the script to delete the snapshots for the X mentioned days

python delete_rds_snapshot.py us-east-1 db-master-1 7 delete

Script Usage

usage: delete_rds_snapshots.py [-h] region rds_instance_name days action
positional arguments:
    region              US-EAST-1 or US-WEST-2
    rds_instance_name   ex: db-master-1
    days                X number of days snapshots need to be deleted
    action              list: prints all the available snapshots to delete
                        delete: delete all the snapshots which are older than the x days
optional arguments:
     -h, --help         show this help message and exit

About

Python Boto script to delete rds snapshots older than X days

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages