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." 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