Docker image for AutoArchive - a simple backup utility
Create a simple backup with:
$ docker run --rm -v /path/to/data:/opt/aa/mounts -v /var/backups:/opt/aa/backup openhs/autoarchive backup
Content of the host directory /path/to/data will be archived as /var/backups/backup.tar.gz on the host.
For incremental backups the container needs to be kept because it will be re-run for subsequent increments. To create level 0 increment execute:
$ docker run --name data_backup -v /path/to/data:/opt/aa/mounts \
-v /opt/backups:/opt/aa/backup openhs/autoarchive backup-incremental
Subsequent increments can be created with:
$ docker start -i data_backup
For more fine grained control it is possible to specify custom archive configurations. To do so pass a host directory with your custom archive specification files as a volume mounted to /opt/aa/config/archive_specs.
Let's have two archive specification files -- one intended to backup /home and the other /etc directory on the host:
$ ls /var/archive_configs
home.aa etc.aa
$ cat home.aa
[Content]
path = /opt/aa/mounts
include-files = home
exclude-files =
$ cat etc.aa
[Content]
path = /opt/aa/mounts
include-files = etc
exclude-files =
Hosts directories /home and /etc needs to be mounted into the container at
the place where it is expected by AutoArchive (which is determined by path and
include-files options above).
$ docker run --rm \
-v /var/archive_configs:/opt/aa/config/archive_specs \
-v /home:/opt/data/mounts/home \
-v /etc:/opt/data/mounts/etc \
-v /opt/backups:/opt/aa/backup \
openhs/autoarchive --all
Option --all causes to create all configured backups which in our case are
home and etc.
To interact with the existing container use --volumes-from Docker option. For
example to show information about the incremental archive from the example above run:
$ docker run --rm --volumes-from data_backup openhs/autoarchive --list
To see help screen run:
$ docker run --rm openhs/autoarchive --help
AutoArchive is pre-configured with two archives: backup and backup-incremental. Both of them backup everything under /opt/aa/mounts and the resulting backup file is put into /opt/aa/backup within the container. Backup creation therefore requires specifying desired host directories as volumes mounted to the paths above.
The incremental backup creates 9 increments before restarting back to increment level 1. When restarting, new level 1 increment is created and all the old increments (level 2 to level 9) are removed.
This describes upgrade process between docker image versions in case there are incompatible changes. The version of the image your container was created from can be printed with command:
$ docker container inspect -f "{{ .Config.Labels.version }}" <container_name>
Path for archive specification files has changed from /opt/aa/archive_specs to /opt/aa/config/archive_specs. Update of corresponding mount point might be needed.
Volume storing the internal program data (storage and snapshots directories) has changed. Mountpoint of volume storing the internal program data (storage and snapshots directories) has changed from /opt/aa/user_config_dir to /opt/aa/program_data/aa. Data needs to be copied to the new volume.