2024-03-14 17:19:26 +00:00
|
|
|
#!/bin/bash
|
2024-03-10 17:59:18 +00:00
|
|
|
|
2024-03-14 17:19:26 +00:00
|
|
|
USER=thomas
|
|
|
|
export XDG_RUNTIME_DIR=/run/user/1000
|
2024-03-10 17:59:18 +00:00
|
|
|
|
2024-04-15 16:25:16 +01:00
|
|
|
source /home/thomas/.env
|
2024-03-14 17:19:26 +00:00
|
|
|
|
2024-05-09 07:37:16 +01:00
|
|
|
if mountpoint -q /media/backups-home; then
|
|
|
|
sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf hourly
|
|
|
|
# sudo /usr/bin/rsnapshot hourly
|
2024-03-14 17:19:26 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2024-05-09 07:37:16 +01:00
|
|
|
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅🏠 Hourly `/home` backup completed successfully'
|
2024-04-15 16:25:16 +01:00
|
|
|
else
|
2024-05-09 07:37:16 +01:00
|
|
|
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🏠 Hourly `/home` backup failed.'
|
2024-03-14 17:19:26 +00:00
|
|
|
fi
|
2024-03-10 17:59:18 +00:00
|
|
|
else
|
2024-03-14 17:19:26 +00:00
|
|
|
echo "Backup drive not mounted"
|
2024-05-09 07:37:16 +01:00
|
|
|
/home/thomas/repos/slack-notifier/src/index.js 'backups' '💾🏠 Error: `/home` backup drive not mounted.'
|
2024-03-10 17:59:18 +00:00
|
|
|
fi
|