diff --git a/README.md b/README.md index 3dcc8fa..9f6f044 100644 --- a/README.md +++ b/README.md @@ -107,3 +107,10 @@ For example: ``` docker run -v [volume-name]:/volume --rm loomchild/volume-backup backup -v > [archive-name] ``` + +1. Pass additional arguments to the Tar utility using `-x` option + ``` + docker run -v [volume-name]:/volume --rm loomchild/volume-backup backup -x --verbose > [archive-name] + ``` + + diff --git a/volume-backup.sh b/volume-backup.sh index 2efe35e..d06f16b 100755 --- a/volume-backup.sh +++ b/volume-backup.sh @@ -7,6 +7,7 @@ usage() { >&2 echo " -c chooose compression algorithm: bz2 (default), gz, xz, zstd and 0 (none)" >&2 echo " -e exclude files or directories (only for backup operation)" >&2 echo " -v verbose" + >&2 echo " -x pass additional arguments to the Tar utility" } backup() { @@ -46,7 +47,7 @@ COMPRESSION="bz2" OPTIND=2 -while getopts "h?vc:e:" OPTION; do +while getopts "h?vc:e:x:" OPTION; do case "$OPTION" in h|\?) usage @@ -70,6 +71,12 @@ while getopts "h?vc:e:" OPTION; do TAROPTS="$TAROPTS --checkpoint=.1000" EOLN=1 ;; + x) + if [ -z "$OPTARG" ]; then + usage + exit 1 + fi + TAROPTS="$TAROPTS $OPTARG" esac done