Skip to content

Commands

Niclas Lindstedt edited this page May 25, 2021 · 7 revisions

Everything docker-backup does, can be done by using the built-in commands.

Issuing a command

Assuming you named your backup service backup, you can type the following to issue a command:

docker-compose exec backup <command>

If you named your backup container something else, replace backup with that name.

Reference

backup [volume]

Backup all volumes inside the /volumes folder if used without parameters.

If you wish to backup a specific folder, simply specify that folder name.

E.g. if you have mounted a folder at /volumes/nginx-config, you would issue backup nginx-config to backup that folder.

store [volume]

Copies the latest backups for each folder in the /volumes directory OR a specific volume (if specified) to the long-term storage in the /lts directory.

prune [volume]

Purges the /backup folder for old backups (specified by the KEEP_BACKUPS_FOR_DAYS environment variable) and prunes the /lts folder according to the prune environment variables.

If no volume is given, all volume backups are pruned.

restore [volume | backup filename]

Restores all volumes to their latest backup if used without parameters.

If you wish to restore a specific volume, specify that volume name.

If you wish to restore a specific backup, specify that backup name, e.g. restore sample-app-20210510071751.tgz

The restore script will verify the backup's integrity before restoring. It will then perform a pre-restore backup of the current volume, before removing all its contents. Only after this, the backup (specified in the command) will be restored into the volume.

Clone this wiki locally