Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #!/bin/bash
  2. # Current Size
  3. CURRENT=$(cat ~/currentSize.txt)
  4.  
  5. # check for new size of the folder
  6. GET=$(du -sB GB [insert path here] | grep -Eo '[0-9\]+' > newSize.txt)
  7. NEW=$(cat newSize.txt)
  8. WRITE=$(cat ~/newSize.txt > ~/currentSize.txt)
  9.  
  10. if [ $NEW -gt $CURRENT -a $NEW -ne $CURRENT ]; then
  11. $WRITE
  12. [run thing here]
  13. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement