/Tiktalik-Backup

Script for backing up MySQL DBs and files to Tiktalik Files.

Primary LanguagePython

Tiktalik-Backup

Simple Python backup script for backing up files and MySQL dumps on Tiktalik Files.

Requirements

This script requires boto. To install boto simply -

pip install boto

Configuration

The script requires the following configuration parameters

Tiktalik Files

  • 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