Go to file
Steph cd5b05eede
All checks were successful
continuous-integration/drone/tag Build is passing
👷 We now have images!
2021-02-08 16:58:14 +01:00
mnt/duplicity 🎉 First version! 2021-01-31 22:00:23 +01:00
.drone.yml 👷 We now have images! 2021-02-08 16:58:14 +01:00
.gitignore 🎉 First version! 2021-01-31 22:00:23 +01:00
backup.conf.example 🎉 First version! 2021-01-31 22:00:23 +01:00
backup.sh 🎉 First version! 2021-01-31 22:00:23 +01:00
crontab 🎉 First version! 2021-01-31 22:00:23 +01:00
docker-compose.yml 👷 We now have images! 2021-02-08 16:58:14 +01:00
Dockerfile 🎉 First version! 2021-01-31 22:00:23 +01:00
LICENSE 🎉 First version! 2021-01-31 22:00:23 +01:00
readme.md 🎉 First version! 2021-01-31 22:00:23 +01:00
services.conf.example 🎉 First version! 2021-01-31 22:00:23 +01:00

Automatic service backup

This docker container will backup services on a schedule, using duplicity as an back end.

How to configure

To configure file hosting locations you can add storage locations to the services.conf file. One per line, you can add duplicity connections. The syntax of these can be found in their docs.

After changing the services.conf file, you'll have to rebuild the container.

The script sends logs to the docker log socket (as is usual with containers).

docker-compose build
docker-compose up -d
docker-compose logs -f

How to use

This docker container assumes that you use the following directory structure:

some_folder/
	service1/
		backup.conf
	service2/
		backup.conf
	service3/

By default, some_folder is mapped to /services as this is where my services reside. You can change this in the docker-compose.yml file.

If you put a backup.conf file into a service's directory it will get backed up. If you omit this file, the service will be skipped.

The contents of the backup file are a duplicity include list. You can find more documentation about them at their docs

You can find an example file with some comments at backup.conf.example.

Backup file syntax

Lines starting with ## are comments.

Lines starting with # are interpreted as variable assignments. There are three variables used to control backup behaviour.

## These are also the default values
# RETAIN=1M
# INCREMENT=1W
# INTERVAL=1H

RETAIN specifies how long backups should be kept around.
INCREMENT specifies how long incremental backups are made before creating a full backup again. This will make a full backup every week.
INTERVAL specifies how long between backups.

The RETAIN and INCREMENT variables are directly fed into duplicity and use their syntax. The INTERVAL variable is read by the container, and has the following options:

1M for once each month
1W for once each week
1D for once each day
1H for once each hour

2H for once each two hours
6H for once each six hours
12H for twice each day

Values must be whole integers, and the minimal value possible is 1H.