From: Andrew Ruthven Date: Wed, 25 Jun 2014 08:32:02 +0000 (+1200) Subject: Schedule a backup run for 10 minutes time. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e146c962130b17430a1dbe24b6c3b70a7b593fb;p=laptop-tools.git Schedule a backup run for 10 minutes time. --- 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/\/.*//')