dotfiles/backups/cron/daily.sh
2024-04-15 16:25:16 +01:00

18 lines
740 B
Bash
Executable file

#!/bin/bash
USER=thomas
export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env
if mountpoint -q /media/backups; then
sudo /usr/bin/rsnapshot daily
if [ $? -eq 0 ]; then
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅ Daily backup completed successfully.'
else
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔ Daily backup failed.'
fi
else
echo "Backup drive not mounted"
/home/thomas/repos/slack-notifier/src/index.js 'backups' '💾 Error: backup drive not mounted.'
fi