Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/bin/bash
  2. #Ellenőrizni kívánt DB mentések helye
  3. cd /
  4. cd backup/
  5.  
  6. #Változók
  7. current=`date +%s`
  8. file=`ls -Art | tail -n 1`
  9. last_modified=`stat -c "%Y" $file`
  10.  
  11. #Csak tesztelésre
  12. echo $current
  13. echo $file
  14. echo $last_modified
  15.  
  16. #Feltételek kiértékelése
  17. if [ $(($current-$last_modified)) -le 3500 ]; then
  18. echo "OK, DB backup timestamp is good!";
  19. exit 0
  20.  
  21. elif [ $(($current-$last_modified)) -gt 3900 ];
  22. then echo "CRITICAL, DB backup timestamp is too old! Please check on the server!";
  23. exit 2
  24. else
  25. echo "UNKNOWN"
  26. exit 3
  27. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement