Advertisement
Guest User

Untitled

a guest
Nov 21st, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #!/bin/bash
  2. ssdPerc=$(df /home | awk '{ print $5 }' | tail -n 1)
  3. ssdAct=${ssdPerc::-1}
  4. hddPerc=$(df /raid | awk '{ print $5 }' | tail -n 1)
  5. hddAct=${hddPerc::-1}
  6.  
  7. If [ "$ssdAct" -gt 1 ]
  8. then
  9. echo "Running out of space on the SSD. Current usage is at $ssdPerc" | mail -s "WARNING: Server SSD Usage at $ssdPerc" zachoooo@gmail.com
  10. fi
  11.  
  12. If [ "$hddAct" -gt 1 ]
  13. then
  14. echo "Running out of space on the HDD. Current usage is at hddPerc" | mail -s "WARNING: Server HDD Usage at $hddPerc" zachoooo@gmail.com
  15. fi
  16.  
  17.  
  18. root@zsugano:/usr/bin# storage_check
  19. /usr/bin/storage_check: line 7: If: command not found
  20. /usr/bin/storage_check: line 8: syntax error near unexpected token `then'
  21. /usr/bin/storage_check: line 8: `then'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement