18 lines
570 B
Bash
Executable File
18 lines
570 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Notifies all users that a backup is running
|
|
|
|
for u in $(users); do
|
|
|
|
notify_cmd="sudo -u $u DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(sudo -u $u id -u)/bus notify-send"
|
|
$notify_cmd 'Starting snap-sync backups to '$1'...' --icon=dialog-information
|
|
|
|
/usr/bin/snap-sync --UUID $1 --noconfirm
|
|
if [[ $? == 0 ]]; then
|
|
$notify_cmd 'snap-sync backups to '$1' complete!' --icon=dialog-information
|
|
else
|
|
$notify_cmd 'Error in snap-sync backups. Check journal for more information.' --icon=dialog-error
|
|
fi
|
|
|
|
done
|