Sign inSign up

investtools/backup

By investtools

•Updated about 8 years ago

docker-backup is a Docker image that allows scheduled backups.

Image
0

689

investtools/backup repository overview

⁠docker-backup

docker-backup is a Docker image that allows scheduled backups.

⁠Structure

⁠Usage

In order to use docker-backup, you need to define the schedule and the backup models.

⁠Schedule definition

You must create a schedule.rb file. For example:

# schedule.rb

every :day, at: '01:00am' do
  backup :database
end

For more information on syntax, read the whenever documentation⁠.

⁠Backup model definition

For each backup defined in schedule.rb you need to write a model file inside the models directory. For example:

# models/database.rb

Model.new(:database, 'Database backup') do
  database MongoDB do |db|
    db.name = "my_database_name"
    db.host = "mongo"
    db.port = 27017
  end
end

For more information, read the Backup gem documentation⁠.

⁠Running the container
$ docker run -d -v `pwd`/schedule.rb:/Backup/schedule.rb -v `pwd`/models:/Backup/models investtools/backup

If you use docker-compose⁠, the docker-compose.yml file would look like this:

# docker-compose.yml

version: '2'
services:
  redis:
    image: redis
  mongo:
    image: mongo
  backup:
    image: investtools/backup
    volumes:
      - ./backup:/Backup
    environment:
      - TZ=America/Sao_Paulo

The content of ./backup can be something like this:

backup/
  schedule.rb
  models/
    redis.rb
    mongo.rb
⁠Supported resources

Although the Backup gem supports a lot of databases⁠, compressors⁠, encryptors⁠, storages⁠, syncers⁠ and notifiers⁠, many of them need system packages that are not installed in this image. The currently installed packages are:

  • MongoDB
  • Redis
  • GPG

If you need another package, you can either open an issue⁠ or fork this repository and edit the Dockerfile⁠.

Tag summary

Content type

Image

Digest

Size

73.6 MB

Last updated

about 8 years ago

docker pull investtools/backup