Giter Club home page Giter Club logo

rds-to-s3-backup's Introduction

RDS to S3 Backup Script

The amazon AWS RDS Service is amazing and creates really good backups in most cases. The only problem I've ran into is that sometimes you want more backups than what AWS allows or you want to do them a different intervals and keep them offsite. Typically AWS RDS Backups are stored on a S3 but you can't get to them. This simple script dumps the data out of the RDS straight to Amazon AWS S3 using the s3cmd and the native mysqldump that comes with ubuntu. Steps to install and configure are listed below.

Install Prerequisites

This install assumes you are on an amazon ec2 instance running ubuntu 15.04. If this is not the case you may use this as a guide to install via your favorite flavor of Linux.

  • $ sudo apt-get install -y s3cmd
  • $ sudo apt-get install -y mysql-client-5.6

Configuration

First get your EC2 to connect by default to the RDS. This can be done with a simple file placed at ~/.my.cnf. A sample of this file is located in the samples folder in this git repo. After this is done configure your s3cmd using s3cmd --configure. You will need your IAM info for s3 at this point.

Last edit the rdstos3backup.sh script and edit the top few lines to suite your needs. For example you might not want --rr because you may want more redundancy than I did. Fix to suite your needs and then save the file in /usr/local/bin/.

Crontab

Optionally you might want to put this script in a crontab to run every night. You can achieve this by using the folllowing crontab:

*    3    *    *    *   /usr/local/bin/rdstos3backup.sh 1>/dev/null >&2

rds-to-s3-backup's People

Contributors

cpierce avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.