Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Current Size
- CURRENT=$(cat ~/currentSize.txt)
- # check for new size of the folder
- GET=$(du -sB GB [insert path here] | grep -Eo '[0-9\]+' > newSize.txt)
- NEW=$(cat newSize.txt)
- WRITE=$(cat ~/newSize.txt > ~/currentSize.txt)
- if [ $NEW -gt $CURRENT -a $NEW -ne $CURRENT ]; then
- $WRITE
- [run thing here]
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement