Compare commits
2 commits
58923c867f
...
d13519229b
Author | SHA1 | Date | |
---|---|---|---|
d13519229b | |||
dbfa74aa26 |
2 changed files with 24 additions and 0 deletions
20
README.md
Normal file
20
README.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# tarback
|
||||||
|
|
||||||
|
Create a tar archive from remote resources.
|
||||||
|
|
||||||
|
This is more or less equivalent to `ssh host tar files | xz | split
|
||||||
|
output-file` and its reverse.
|
||||||
|
|
||||||
|
Two plugins are available:
|
||||||
|
- `ssh` handles all the ssh command and filename escaping necessary
|
||||||
|
- `docker` instead of backing up a remote volume, back up a docker volume
|
||||||
|
|
||||||
|
## usage
|
||||||
|
|
||||||
|
`tarback -p ssh,docker -s 'ssh $user@$host' create "$remote_volume_name" "$local_tar_archive"`
|
||||||
|
|
||||||
|
Create a split tar archive of the remote volume, with the extensions `part{a-z,a-z}`.
|
||||||
|
|
||||||
|
`tarback -p ssh,docker -s 'ssh $user@$host' restore "$local_tar_archive" "$remote_volume_name"`
|
||||||
|
|
||||||
|
Restore the backup to the remote docker volume.
|
|
@ -3,3 +3,7 @@
|
||||||
_tarback_plugin_docker_cmd='docker run -i --rm --workdir=/mnt --volume="$1":/mnt/"$1" alpine '
|
_tarback_plugin_docker_cmd='docker run -i --rm --workdir=/mnt --volume="$1":/mnt/"$1" alpine '
|
||||||
TARBACK_TAR_CREATE_COMMAND="$_tarback_plugin_docker_cmd "'tar c -C "/mnt/$1" .'
|
TARBACK_TAR_CREATE_COMMAND="$_tarback_plugin_docker_cmd "'tar c -C "/mnt/$1" .'
|
||||||
TARBACK_TAR_EXTRACT_COMMAND="$_tarback_plugin_docker_cmd "'tar x -C "/mnt/$1"'
|
TARBACK_TAR_EXTRACT_COMMAND="$_tarback_plugin_docker_cmd "'tar x -C "/mnt/$1"'
|
||||||
|
|
||||||
|
# Can set file to same as directory command since a docker volume is always a directory
|
||||||
|
TARBACK_TAR_CREATE_COMMAND_FILE="$_tarback_plugin_docker_cmd "'tar c -C "/mnt/$1" .'
|
||||||
|
TARBACK_TAR_EXTRACT_COMMAND_FILE="$_tarback_plugin_docker_cmd "'tar x -C "/mnt/$1"'
|
||||||
|
|
Loading…
Reference in a new issue