Package: coverme
covermeLightweight and easy configurable server backup utility.InstallBasic usageQuestions and answersCommand line helpTips on Amazon services setupLicenseOverviewcovermeacts as a backup data aggregator, it grabs data from different sources and uploads it to Amazon Glacier or Amazon S3. More storage options will be probably available. You're always welcome to fork and make a pull request ;)Requires Python 2.7+ or Python 3.4+ installedShould work on Linux/MacOS/FreeBSDSupports MySQL backups viamysqldumpSupports PostgreSQL backups viapg_dumpSupports directory archiveUploading backups to Amazon S3 as private objectsUploading to Amazon GlacierSchedule backups viacrontabor run manuallyAlso for Amazon services configuration you may need to install AWS command line utilityawscli.InstallInstall via pip:pip install covermeor if only Python 3.x pip is available:pip3 install covermeIf you're going to use Amazon services for backup, you'll also need to set up credentials viaaws configureor manually, seeTips on Amazon services setup.Basic usageJust to make sure that installation is correct run:coverme --helpPlease note!Examples below probably do not provide best security practices! Intermediate backups are stored in shared/tmpdir and backups are not encrypted before upload.Define your backup rules in JSON or YAML config, e.g.backup.yml:---defaults:# tmpdir - base directory for temporary filestmpdir:/tmp# cleanup - remove archive after upload or not, default: nocleanup:yes# localdir - optional, directory for local backupslocaldir:backups# format - optional, default: zipformat:gztarbackups:-type:databaseurl:postgres://postgres@127.0.0.1:5432/testto:[bucket1]name:postgres-{yyyy}-{mm}-{dd}--{HH}-{MM}.sql# tags - optional, no defaulttags:myapp, postgres, db-type:databaseurl:mysql://root@127.0.0.1/testto:[bucket1]name:mysql-{yyyy}-{mm}-{dd}--{HH}-{MM}.sql# tags - optional, no defaulttags:myapp, mysql, db-type:dirpath:/home/myapp/var/www/uploadsto:[glacier1]name:myapp-{yyyy}-{mm}-{dd}--{HH}-{MM}# format - optional, default: zipformat:gztar# tags - optional, no defaulttags:myapp, uploadsvaults:bucket1:service:s3region:eu-west-1# profile - optional, AWS configuration profile# profile: covermename:coverme-testglacier1:service:glacierregion:eu-west-1account:NNNNNNNNNNNNname:coverme-test...Perform test backup using config filebackup.yml:coverme backup -c backup.ymlIf some configutaion error happen, fix it first. For example, may you have to configure AWS credentials withaws configurefirst.Addcovermeto cron jobs:crontab -eMake sure to add PATH environment setting, so cron script could foundpg_dump,mysqldumpand other shell commands:SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# run coverme backups every day at 5:30
30 5 * * * /usr/local/bin/coverme backup -c /home/myapp/backup.ymlReal path tocovermemay be different depending on installation, to get proper full path run:which covermeUsage with DockerDocker container is available asrudyryk/coverme.Here's an example for using indocker-compose.yml:# ... your servicescoverme:image:rudyryk/covermerestart:unless-stoppeddepends_on:-postgresenvironment:PGPASSWORD:${PGPASSWORD}AWS_ACCESS_KEY_ID:${AWS_ACCESS_KEY_ID}AWS_SECRET_ACCESS_KEY:${AWS_SECRET_ACCESS_KEY}volumes:-./coverme/config.yml:/etc/coverme/config.ymlQuestions and answersHow to provide PostgreSQL password forpg_dump?Use~/.pgpassfile with600permissions, see details here:http://www.postgresql.org/docs/current/static/libpq-pgpass.htmlHow to rotate my backups?It's easy to rotate backups using name pattern. For example, specifymysql/dump-{dd}.sqlas name for MySQL dump archive and you will get
sequence of files like that:mysql/dump-01.sql (for 1st day of month)
mysql/dump-02.sql (for 2nd day of month)
...
mysql/dump-31.sql (for 31st day of month)So you will get monthly backups rotation. Some months have 31 day while others have 30 or 28/29, but that should not be a real issue in most cases.Command line helpGet list of available commands:$ coverme --help

Usage: coverme [OPTIONS] COMMAND [ARGS]...

  Command-line interface for coverme.

Options:
  --help  Show this message and exit.

Commands:
  backupGet help forbackupcommand:$ coverme backup --help

Usage: coverme backup [OPTIONS]

Options:
  -c, --config TEXT  Backups configuration file.Specify '-' to read from
                     STDIN.  [default: backup.yml]
  --help             Show this message and exit.Tips on Amazon services setupHow to installawsAmazon command line utility?pip install awscliHow to set up Amazon credentials?aws configureor manually save credentials to~/.aws/credentials:[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY

[another]
; Just a custom profile called 'another', optional section
aws_access_key_id = YOUR_ANOTHER_ACCESS_KEY
aws_secret_access_key = YOUR_ANOTHER_SECRET_KEYHow to get Amazon credentials?Use Amazon Identity and Access Management (IAM) service to manage users:https://console.aws.amazon.com/iam/home#usersHow to create Amazon Glacier vault?You may create vaults using wizard:https://console.aws.amazon.com/glacier/homeHow to grant user access to Glacier?In Amazon Identity and Access Management (IAM) panel on user's details page:Permissions tab->Inline Policies(click to expand) ->Create User PolicyChoosePolicy Generatorand then:Select "Amazon Glacier" in dropdownCheck required pesmissions or mark allSpecify Glacier vault identifier, e.g.arn:aws:glacier:eu-west-1:NNNNNNNNNNNN:vaults/coverme-test, vault should be created firstHow to grant user access to S3?In Amazon Identity and Access Management (IAM) panel on user's details page:Permissions tab->Inline Policies(click to expand) ->Create User PolicyChoosePolicy Generatorand then:Select "Amazon S3" in dropdownCheck required pesmissions or mark allSpecify S3 bucket resources mask, e.g.arn:aws:s3:::coverme-test/*LicenseCopyright (c) 2016, Alexey Kinëvrudy@05bit.comLicensed under The Apache License Version 2.0, January 2004 (Apache-2.0),
see LICENSE file for more details.