From 5e146c962130b17430a1dbe24b6c3b70a7b593fb Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Wed, 25 Jun 2014 20:32:02 +1200 Subject: [PATCH] Schedule a backup run for 10 minutes time. --- NetworkManager/dispatcher.d/20network-shares | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/NetworkManager/dispatcher.d/20network-shares b/NetworkManager/dispatcher.d/20network-shares index 2159099..9ecf3d6 100755 --- a/NetworkManager/dispatcher.d/20network-shares +++ b/NetworkManager/dispatcher.d/20network-shares @@ -11,10 +11,11 @@ then mactest=$(arp -n -a $gateway | awk '{print $4}' | head -1) fi - date >> /tmp/nm.set - echo "$1 $2" >> /tmp/nm.set - set >> /tmp/nm.set - echo >> /tmp/nm.set +date >> /tmp/nm.set +echo "$1 $2" >> /tmp/nm.set +set >> /tmp/nm.set +echo >> /tmp/nm.set + case "$2" in up|vpn-up) if [ "$CONNECTION_UUID" == "$targetuuid" -o "$CONNECTION_UUID" == "$vpnuuid" -o "$mactest" == "$targetmac" ] @@ -27,6 +28,14 @@ case "$2" in do sudo -u $user /usr/bin/network-bookmarks-add done + + # Schedule a backup run for 10 minutes name - makes sure we don't + # try and do a backup if someone is only hoping on the network for + # a short time. + if [ -f /usr/lib/etc-obnam/run-backup ] + then + echo /usr/lib/etc-obnam/run-backup | at now + 10 minutes + fi else echo "On a foreign network, make sure we clean up" >> /tmp/nm.set for user in $(ls /home/*/.gtk-bookmarks | sed 's/\/home\///; s/\/.*//') -- 2.30.2