fixed error in finding errors
This commit is contained in:
parent
9ee18bae78
commit
c94339deca
@ -23,15 +23,13 @@ echo ""
|
|||||||
|
|
||||||
echo -e "\e[0mStarting Backup"
|
echo -e "\e[0mStarting Backup"
|
||||||
|
|
||||||
rsync -rptgpXh --delete-excluded --delete-before --stats --exclude-from=./exclude.txt --include-from=./backup.txt $@ | grep -v '^skipping' | grep -v '^[d-]' | tee backup_data_tmp
|
rsync -rptgpXh --delete-excluded --delete-before --stats --exclude-from=./exclude.txt --include-from=./backup.txt $@ > backup_data_tmp 2>&1
|
||||||
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
curl -H "Title: Backup: $(hostname)" -d "The backup on $(hostname) finished successfully. $(cat ./backup_data_tmp)" https://ntfy.locker98.com/camera_h9CQ0
|
curl -H "Title: Backup: $(hostname)" -d "The backup on $(hostname) finished successfully. $(cat ./backup_data_tmp | grep -v '^[d-]' | grep -v '^skipping')" https://ntfy.locker98.com/camera_h9CQ0
|
||||||
else
|
else
|
||||||
echo "The backup on $(hostname) failed. /n" > "$tempfile"
|
curl -H "Title: Backup: $(hostname)" -H "Priority: urgent" -H "Tags: warning" -d "The backup on $(hostname) failed. $(cat ./backup_data_tmp | grep -v '^[d-]' | grep -v '^skipping')" https://ntfy.locker98.com/camera_h9CQ0
|
||||||
cat ./backup_data_tmp >> "$tempfile"
|
|
||||||
curl -H "Title: Backup: $(hostname)" -H "Priority: urgent" -H "Tags: warning" -d "The backup on $(hostname) failed. $(cat ./backup_data_tmp)" https://ntfy.locker98.com/camera_h9CQ0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm ./backup_data_tmp
|
rm ./backup_data_tmp
|
||||||
|
Loading…
Reference in New Issue
Block a user