From 51f8429aa9915760b31eb686415606d0c9fcff53 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Sat, 28 Jan 2017 07:26:41 -0600 Subject: [PATCH] add script --- bin/snap-sync-wrapper | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 bin/snap-sync-wrapper diff --git a/bin/snap-sync-wrapper b/bin/snap-sync-wrapper new file mode 100755 index 0000000..dc26616 --- /dev/null +++ b/bin/snap-sync-wrapper @@ -0,0 +1,10 @@ +#!/bin/bash + +sudo -u $USER DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus notify-send 'Starting snap-sync backups to $1...' --icon=dialog-information + +#/usr/bin/snap-sync --UUID $1 --noconfirm +if [[ $? == 0 ]]; then + sudo -u $USER DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus notify-send 'snap-sync backups to $1 complete!' --icon=dialog-information +else + sudo -u $USER DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus notify-send 'Error in snap-sync backups. Check journal for more information.' --icon=dialog-information +fi