Skip to content

Instantly share code, notes, and snippets.

@robballou
Created April 22, 2010 15:37
Show Gist options
  • Save robballou/375384 to your computer and use it in GitHub Desktop.
Save robballou/375384 to your computer and use it in GitHub Desktop.
import datettime
import rotatelib
import MySQLdb
db = MySQLdb.connect('localhost', 'user', 'password', 'my_database')
# find any backup tables (tables with a date in the name) that are older than 5 days
items = rotatelib.list_backup_tables(db=db, before=datetime.timedelta(5))
for item in items:
print item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment