dvbackup/README.md

40 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2022-08-30 22:44:38 +02:00
# Docker Volume Backup
A simple script which creates tarballs from docker volumes and restores
them.
## Usage
### Backup a single volume
`./dvbackup.sh backup <volume_name> <path/to/tarball.tar>`
Creates a tarball from the contents of the volume.
### Restore a single volume
`./dvbackup.sh restore <path/to/tarball.tar> <volume_name>`
Restores the tarball into the volume. *This is destructive*, all old
contents will be removed from the volume. The volume must already exist.
### Backup all named volumes
`./dvbackup.sh backup_all`
Creates backups from all volumes which do not only contain the character
set `[0-9a-f]`.
This command will output a `<volume_name>.tar` file for every found
volume in the current working directory.
### Restore volumes
`./dvbackup.sh restore_all [volume.tar...]`
Restores all given tarballs into their respective volumes. The volumes
must already exist and the operation is *destructive* in the same way
as the `restore` operation. The default behaviour is to ask before
continuing, this can be overridden by setting `DVB_I_KNOW_WHAT_I_DO=y`.
Volumes can be created implicitly by setting `DVB_CREATE_VOLUME=y`.