Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Easily cron based mysql database backups from other containers

License

Notifications You must be signed in to change notification settings

yappabe/docker-mysql-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker pulls

Yappa Mysql Backup Image

Usage

Add the following to your docker-compose.yml file:

backup:
    image: yappabe/mysql-backup
    links:
        - mysql
    environment:
        DBS: db1
        MYSQL_USERNAME: mysqlusername
        MYSQL_PASSWORD: mysqlpassword
        MYSQL_HOST: mysql
        RSYNC_COMMAND: "rsync -avz -e \"ssh -p 2122 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null\" %DIR%/* user@host:/backup_path"
        CRON_TIME: "0 17 * * *"
        NOTIFICATION_SERVICE: slack
        SLACK_HOOK_URL: "https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXXXXXX"
        SLACK_CHANNEL: "#general"
        SLACK_USERNAME: "container-mysql-backup"
        SLACK_EMOJI: "package"

The container isn't authorized to access the remote server

You can generate/add or mount a private key:

volumes:
        - ~/.ssh/id_rsa:/root/.ssh/id_rsa

About

Easily cron based mysql database backups from other containers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages