Files
linux-scripts/fileserver/akanealw/rsync-backup-awsvps.sh
2023-08-26 16:14:53 -05:00

18 lines
621 B
Bash

#!/bin/bash
if ping -c 1 192.168.1.41 &> /dev/null
then
sudo mount -a -v
rsync -azvP -e "ssh -i ~/.ssh/awsvps" --progress \
--include=/ \
--include=/etc/ \
--include=/etc/iptables/*** \
--include=/etc/nginx/*** \
--include=/etc/wireguard/*** \
--exclude=* \
root@awsvps:/ /mnt/backups/awsvpsbackups/$(/bin/date +%Y-%m-%d-%I-%M-%S-%p)
curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/otthp467K9?status=up&msg=OK&ping=
else
curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/otthp467K9?status=down&msg=OK&ping=
fi