Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Ellenőrizni kívánt DB mentések helye
- cd /
- cd backup/
- #Változók
- current=`date +%s`
- file=`ls -Art | tail -n 1`
- last_modified=`stat -c "%Y" $file`
- #Csak tesztelésre
- echo $current
- echo $file
- echo $last_modified
- #Feltételek kiértékelése
- if [ $(($current-$last_modified)) -le 3500 ]; then
- echo "OK, DB backup timestamp is good!";
- exit 0
- elif [ $(($current-$last_modified)) -gt 3900 ];
- then echo "CRITICAL, DB backup timestamp is too old! Please check on the server!";
- exit 2
- else
- echo "UNKNOWN"
- exit 3
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement