From e847c5cbfc11a6227e52f9d439026979a4944c00 Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Mon, 11 Mar 2019 12:34:26 +0100 Subject: [PATCH 1/2] some updates --- duply-backup-lenny.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/duply-backup-lenny.sh b/duply-backup-lenny.sh index 01fdae6..d724f6b 100755 --- a/duply-backup-lenny.sh +++ b/duply-backup-lenny.sh @@ -2,18 +2,19 @@ ping -c2 tumor.chaos 1>/dev/null || exit 0 +CMD=$@ LOGDIR=/var/log/backup DIR=/etc/duply [[ -d $LOGDIR ]] || mkdir -p $LOGDIR XUSER=$(who |grep :0 |cut -f 1 -d ' ') XUID=$(id -u ${XUSER}) -NOTIFYCMD="sudo -u ${XUSER} DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${XUID}/dbus /usr/bin/notify-send -c Backup -a duply" +NOTIFYCMD="su - ${XUSER} DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${XUID}/bus /usr/bin/notify-send -c Backup -a duply" for I in ${DIR}/lenny*; do BCKP=$(basename $I) ${NOTIFYCMD} ${BCKP} "Starting Backup..." - /usr/bin/duply $BCKP pre_incr_post 2&>1 >${LOGDIR}/${BCKP}.log; + /usr/bin/duply $BCKP ${CMD} 2&>1 >${LOGDIR}/${BCKP}.log; FIN=$? if [ $FIN -eq 0 ]; then ${NOTIFYCMD} --icon=sync-synchronizing ${BCKP} "Backup success." From 8f22b8bbdfe355d4cef8a6e1ca4c75b2a252f34c Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Tue, 10 Dec 2019 20:05:02 +0100 Subject: [PATCH 2/2] remove messages in mqtt by topic --- mqtt/remove_retained_topic.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 mqtt/remove_retained_topic.sh diff --git a/mqtt/remove_retained_topic.sh b/mqtt/remove_retained_topic.sh new file mode 100755 index 0000000..ebba51c --- /dev/null +++ b/mqtt/remove_retained_topic.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo "cleaning " $1 " :: usage: cleanmqtt " +mosquitto_sub -h $1 -t "${2}/#" -v | while read line; do mosquitto_pub -h $1 -t "${line% *}" -r -n; done