diff options
| author | Anton Bobov <anton@bobov.name> | 2023-09-14 23:16:58 +0500 |
|---|---|---|
| committer | Anton Bobov <anton@bobov.name> | 2023-09-14 23:16:58 +0500 |
| commit | f48019eaef7bb6ca256d391a51401fc3c9728d58 (patch) | |
| tree | b9fca6efed21c582662a963974ff58f9b41cb7a0 | |
| parent | 14325e1964c5939e5139297ce5897f929dc1e025 (diff) | |
Updates
| -rwxr-xr-x | d-backup | 92 | ||||
| -rwxr-xr-x | pit-run | 2 | ||||
| -rwxr-xr-x | through-vpn.sh | 4 |
3 files changed, 52 insertions, 46 deletions
@@ -7,9 +7,9 @@ # TARGET="sftp://server/path" # ---------------- 8< -------------------- -if [ ! "$(whoami)" = root ] ; then - echo "This script must be run by the user: root" - exit 1 +if [ ! "$(whoami)" = root ]; then + echo "This script must be run by the user: root" + exit 1 fi HOME=/home/anton @@ -20,7 +20,7 @@ source "$HOME/.duplicity.conf" SOURCE=/ print_help() { - cat <<EOF + cat <<EOF Commands: backup run backup cleanup cleanup @@ -32,60 +32,68 @@ Options: EOF } +_duplicity() { + GNUPGHOME=/root/.gnupg nice ionice duplicity $DUPLICITY_OPTS "$@" +} + backup() { - nice ionice duplicity $DUPLICITY_OPTS \ - --exclude-filelist "$HOME/.duplicity-exclude" \ - --full-if-older-than "$FULL_IF_OLDER_THAN" \ - "$SOURCE" "$TARGET" - cleanup + _duplicity --exclude-filelist "$HOME/.duplicity-exclude" \ + --full-if-older-than "$FULL_IF_OLDER_THAN" \ + "$SOURCE" "$TARGET" + cleanup } cleanup() { - duplicity $DUPLICITY_OPTS cleanup --force "$TARGET" - duplicity $DUPLICITY_OPTS remove-all-but-n-full $REMOVE_ALL_BUT_N_FULL --force "$TARGET" + _duplicity cleanup --force "$TARGET" + _duplicity remove-all-but-n-full $REMOVE_ALL_BUT_N_FULL --force "$TARGET" } stats() { - duplicity $DUPLICITY_OPTS collection-status "$TARGET" + _duplicity collection-status "$TARGET" } list() { - duplicity $DUPLICITY_OPTS list-current-files "$@" "$TARGET" + _duplicity list-current-files "$@" "$TARGET" } restore() { - duplicity $DUPLICITY_OPTS restore "$@" "$TARGET" "$(pwd)" + _duplicity restore "$@" "$TARGET" "$(pwd)" } -if [[ $# = 0 ]] ; then - print_help - exit 0 +if [[ $# = 0 ]]; then + print_help + exit 0 fi -while (( "$#" )) ; do - case "$1" in - backup) - backup - ;; - cleanup) - cleanup - ;; - stats) - stats - ;; - list) - shift - list "$@" - exit 0 - ;; - restore) - shift - restore "$@" - exit 0 - ;; - *) - print_help - ;; - esac +while (("$#")); do + case "$1" in + backup) + backup + ;; + cleanup) + cleanup + ;; + stats) + stats + ;; + list) shift + list "$@" + exit 0 + ;; + restore) + shift + restore "$@" + exit 0 + ;; + -h | --help | help) + print_help + ;; + *) + shift + _duplicity "$@" + exit 0 + ;; + esac + shift done @@ -12,7 +12,7 @@ import xml.etree.ElementTree as ET PIT_GROUP_ID = 'org.pitest' PIT_ARTIFACT_ID = 'pitest-maven' -PIT_VERSION = '1.14.2' +PIT_VERSION = '1.14.4' PIT_JUNIT5_ARTIFACT_ID = 'pitest-junit5-plugin' PIT_JUNIT5_VERSION = '1.2.0' NAMESPACES = {'': 'http://maven.apache.org/POM/4.0.0'} diff --git a/through-vpn.sh b/through-vpn.sh index 3d71404..7e9e1ee 100755 --- a/through-vpn.sh +++ b/through-vpn.sh @@ -8,6 +8,4 @@ if [ $# -eq 0 ] ; then exit 1 fi -comment=$(date +%F) - -ssh riga "/ip firewall address-list add address=$1 list=through-vpn comment=\"$comment\"" +ssh riga "/ip firewall address-list add address=$1 list=through-vpn" |
