Skip to content

jamesblackwell/Python-S3-Backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Python-S3-Backup

Simple Python backup script for backing up files and MySQL dumps on Amazon S3.

Requirements

This script requires boto. To install boto simply -

pip install boto

Configuration

The script requires the following configuration parameters

AWS

  • Access Key - aws_access_key
  • Secret Key - aws_secret_key
  • Bucket - aws_bucket

MySQL

  • Hostname - mysql_hostname
  • Username - mysql_username
  • Password - mysql_password
  • MySQL Dump Path - mysql_dump_path

Directories

You can backup as many directories as you like. Simply define it as a list and include the full path, e.g.

dirs = [
        '/srv/www/domain1.com',
        '/srv/www/domain2.com'
        ]

Databases

You can define the databases to be backed up the same way as the directories. Make sure your user has sufficient privilidges to access all databases, if more than one.

dbs = [
        'domain1_app',
        'domain1_blog',
        ]

Crontab

Sample cron to run backup every day at 23.00.

0 23 * * * python ~/scripts/backup.py

About

Script for backing up MySQL DBs and files to S3.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published