mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2025-05-25 19:14:39 +02:00
[cron] adding all cron-scripts
This commit is contained in:
parent
c3b682b26f
commit
749a7f45af
3 changed files with 73 additions and 0 deletions
17
cron/borg-notify.sh
Executable file
17
cron/borg-notify.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
## */10 * * * * cd ~/.dotfiles/cron/ && bash borg-notify.sh
|
||||
|
||||
LAST=$(tail -1 ~/.borgbackup.log)
|
||||
|
||||
DIF=$((($(date -d "now" +%s) - $(date -d $LAST +%s)) / 86400))
|
||||
|
||||
if [ $DIF -ge 7 ] ; then
|
||||
export DISPLAY=:0
|
||||
for proc in $(pgrep -u $USER); do
|
||||
if grep -z DBUS_SESSION_BUS_ADDRESS /proc/$proc/environ; then
|
||||
export DBUS_SESSION_BUS_ADDRESS="$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$proc/environ | sed -e 's/DBUS_SESSION_BUS_ADDRESS=//')"
|
||||
break
|
||||
fi
|
||||
done
|
||||
notify-send -i drive-harddisk Borg-Backup "Your last backup was $DIF days ago.\nPlease make a new one."
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue