updated scripts

This commit is contained in:
2023-08-20 19:02:10 -05:00
parent 7976d08960
commit a13ad3f657
3 changed files with 12 additions and 4 deletions

View File

@@ -29,10 +29,13 @@ if ping -c 1 192.168.1.41 &> /dev/null
# fileserver
echo "starting fileserver backup"
cp -prv /home/akanealw/scripts/ /home/akanealw/gitrepos/fileserver/files/bashscripts/fileserver/akanealw/
sudo cp -prv /root/scripts/ /home/akanealw/gitrepos/fileserver/files/bashscripts/fileserver/root/
rsync -azvP /home/akanealw/scripts/ /home/akanealw/gitrepos/fileserver/files/bashscripts/fileserver/akanealw/
sudo rsync -azvP /root/scripts/ /home/akanealw/gitrepos/fileserver/files/bashscripts/fileserver/root/
# chown all files copied
echo "chowning all backup files in repo"
sudo chown -R akanealw:akanealw /home/akanealw/gitrepos/fileserver/files/
else
echo "TrueNAS is offline"
echo "TrueNAS is offline" curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/vwn8owCG7W?status=down&msg=OK&ping=
fi
curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/vwn8owCG7W?status=up&msg=OK&ping=

View File

@@ -0,0 +1,5 @@
#!/bin/bash
until ping -c1 192.168.1.41 >/dev/null 2>&1; do :; done
sleep 45
mount -t nfs -o defaults,nolock,soft,vers=4.2 192.168.1.41:/mnt/data/fileserver /mnt/truenasfileserver -v

View File

@@ -20,5 +20,5 @@ if ping -c 1 192.168.1.41 &> /dev/null
/ 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
curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/OtvHGEeMxL?status=down&msg=OK&ping=
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