Merge branch 'master' of lab.maketank.net:hacking/spielplatz
This commit is contained in:
@@ -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."
|
||||
|
||||
3
mqtt/remove_retained_topic.sh
Executable file
3
mqtt/remove_retained_topic.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "cleaning " $1 " :: usage: cleanmqtt <host> <topic>"
|
||||
mosquitto_sub -h $1 -t "${2}/#" -v | while read line; do mosquitto_pub -h $1 -t "${line% *}" -r -n; done
|
||||
Reference in New Issue
Block a user