Files
dsnap-sync/bin/snap-sync-wrapper
James Barnett 51f8429aa9 add script
2017-01-28 07:26:41 -06:00

11 lines
598 B
Bash
Executable File

#!/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