save-data-dir 235 Bytes
#!/bin/sh

data_dir="$1"
data_name="$2"
shift 2

mkdir -p /var/lib/docker-init/data
tar -C "$data_dir" -c . | gzip -9v > "/var/lib/docker-init/data/$data_name.data.tar.gz"
find "$data_dir" -mindepth 1 -maxdepth 1 -exec rm -rf '{}' ';'