From 279750251f0d6e864d3d80855b7fd3164387e3c6 Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Sun, 10 May 2020 22:10:27 +0500 Subject: Updates. --- d-backup | 12 ++++++------ xml-format | 12 ++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100755 xml-format diff --git a/d-backup b/d-backup index 77361d9..a2efa4d 100755 --- a/d-backup +++ b/d-backup @@ -31,7 +31,7 @@ EOF } backup() { - nice ionice duplicity \ + nice ionice duplicity $DUPLICITY_OPTS \ --exclude-filelist "$HOME/.duplicity-exclude" \ --full-if-older-than 2M \ "$SOURCE" "$TARGET" @@ -39,20 +39,20 @@ backup() { } cleanup() { - duplicity cleanup --force "$TARGET" - duplicity remove-all-but-n-full 3 --force "$TARGET" + duplicity $DUPLICITY_OPTS cleanup --force "$TARGET" + duplicity $DUPLICITY_OPTS remove-all-but-n-full 3 --force "$TARGET" } stats() { - duplicity collection-status "$TARGET" + duplicity $DUPLICITY_OPTS collection-status "$TARGET" } list() { - duplicity list-current-files "$@" "$TARGET" + duplicity $DUPLICITY_OPTS list-current-files "$@" "$TARGET" } restore() { - duplicity restore "$@" "$TARGET" "$(pwd)" + duplicity $DUPLICITY_OPTS restore "$@" "$TARGET" "$(pwd)" } if [[ $# = 0 ]] ; then diff --git a/xml-format b/xml-format new file mode 100755 index 0000000..76a29bb --- /dev/null +++ b/xml-format @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +if [ -x "$(command -v xmlstarlet)" ] ; then + xmlstarlet format --omit-decl +elif [ -x "$(command -v xmllint)" ] ; then + xmllint --format - +else + exit 1 +fi + -- cgit v1.2.3