25 lines
875 B
Bash
Executable File
25 lines
875 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if ping -c 1 192.168.1.41 &> /dev/null
|
|
then
|
|
rsync -azvP -e "ssh -i ~/.ssh/truenas" --progress \
|
|
--include=/ \
|
|
--include=/home/*** \
|
|
--include=/etc \
|
|
--include=/etc/fstab \
|
|
--include=/etc/default/*** \
|
|
--include=/etc/dnsmasq.d/*** \
|
|
--include=/etc/forgejo/*** \
|
|
--include=/etc/nginx/*** \
|
|
--include=/etc/wireguard/*** \
|
|
--include=/srv/*** \
|
|
--include=/var \
|
|
--include=/var/lib \
|
|
--include=/var/lib/forgejo/*** \
|
|
--exclude=* \
|
|
/ akanealw@192.168.1.41:/mnt/data/backups/fileserverbackup/$(/bin/date +%Y-%m-%d-%I-%M-%S-%p)
|
|
curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/OtvHGEeMxL?status=up&msg=OK&ping=
|
|
else
|
|
echo "TrueNAS is offline" && curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/OtvHGEeMxL?status=down&msg=OK&ping=
|
|
fi
|