Package: s3-backups
OverviewS3 Backups provides easy scripts that system administrators can use to backup
data from programs likes PostgreSQL, MySQL, Redis, etc.InstallationTo install s3-backups:$ sudo pip install s3-backupsUsageSetting Up S3 Backups to Run Automatically Using CronPostgreSQLAdd the following to the file/etc/cron.d/postgres_to_s3and then change the command arguments so the command is using your correct AWS credentials, backup bucket and the correct base S3 Key/base folder.0 */1 * * * postgres /usr/local/bin/postgres_to_s3.py --AWS_ACCESS_KEY_ID='xxxxxxxxxxxxxxxxxxxx' --AWS_SECRET_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx' --S3_BUCKET_NAME='my-backup-bucket' --S3_KEY_NAME='postgres/my-awesome-server' --backup --archiveRedisAdd the following to the file/etc/cron.d/redis_to_s3and then change the command arguments so the command is using your correct AWS credentials, backup bucket and the correct base S3 Key/base folder.0 */1 * * * root redis_to_s3.py --AWS_ACCESS_KEY_ID='xxxxxxxxxxxxxxxxxxxx' --AWS_SECRET_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx' --S3_BUCKET_NAME='my-backup-bucket' --S3_KEY_NAME='redis/my-awesome-server' --backup --archiveMySQLAdd the following to the file/etc/cron.d/mysql_to_s3and then change the command arguments so the command is using your correct AWS credentials, backup bucket and the correct base S3 Key/base folder.0 */1 * * * root mysql_to_s3.py --AWS_ACCESS_KEY_ID='xxxxxxxxxxxxxxxxxxxx' --AWS_SECRET_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx' --S3_BUCKET_NAME='my-backup-bucket' --S3_KEY_NAME='redis/my-awesome-server' --backup --archiveManually Running Backups and ArchivingWhen running the archive command, S3 Backups moves backups into ayear/monthsub folder (technically a S3 key) for archives it’s scheduled
to keep and removes all other archives. S3 Backups, will use the default
schedule unless you you tell it to use a different schedule with the--schedule_moduleargument.The default archive schedule will …keep all archives for 7 dayskeep midnight backups for every other day for 30 dayskeep the first day of the month foreverremove all other files that aren’t scheduled to be keptTo backup PostgreSQL, run the following:$ postgres_to_s3.py \
--AWS_ACCESS_KEY_ID='xxxxxxxxxxxxxxxxxxxx' \
--AWS_SECRET_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx' \
--S3_BUCKET_NAME='my-backup-bucket' \
--S3_KEY_NAME='postgres/my-awesome-server' \
--backupTo archive PostgreSQL backups, run the following:$ postgres_to_s3.py \
--AWS_ACCESS_KEY_ID='xxxxxxxxxxxxxxxxxxxx' \
--AWS_SECRET_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx' \
--S3_BUCKET_NAME='my-backup-bucket' \
--S3_KEY_NAME='postgres/my-awesome-server' \
--archiveTo backup Redis, run the following:$ redis_to_s3.py \
--AWS_ACCESS_KEY_ID='xxxxxxxxxxxxxxxxxxxx' \
--AWS_SECRET_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx' \
--S3_BUCKET_NAME='my-backup-bucket' \
--S3_KEY_NAME='redis/my-awesome-server' --backupTo archive Redis, run the following:$ redis_to_s3.py \
--AWS_ACCESS_KEY_ID='xxxxxxxxxxxxxxxxxxxx' \
--AWS_SECRET_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx' \
--S3_BUCKET_NAME='my-backup-bucket' \
--S3_KEY_NAME='redis/my-awesome-server' --archiveTo backup MySQL, run the following:$ mysql_to_s3.py \
--AWS_ACCESS_KEY_ID='xxxxxxxxxxxxxxxxxxxx' \
--AWS_SECRET_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx' \
--S3_BUCKET_NAME='my-backup-bucket' \
--S3_KEY_NAME='redis/my-awesome-server' --backupTo archive MySQL, run the following:$ mysql_to_s3.py \
--AWS_ACCESS_KEY_ID='xxxxxxxxxxxxxxxxxxxx' \
--AWS_SECRET_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx' \
--S3_BUCKET_NAME='my-backup-bucket' \
--S3_KEY_NAME='redis/my-awesome-server' --archiveContributeIf you’d like to contribute, create an issue to get a dialog going about the
feature you want to add. After a plan is place then fork the repository and
create your fix or feature on a new branch. When your finished, make a pull
request to get your changes pulled in.