Created
November 3, 2013 09:57
-
-
Save bguiz/7288196 to your computer and use it in GitHub Desktop.
useful for automating deployments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://bitbucket.org/denilsonsa/small_scripts/raw/9159fee62dc7cca7f81f47cef41bd9ae1324553e/sleep_until_modified.py | |
chmod u+x ./sleep_until_modified.py | |
touch testfile.old | |
touch testfile | |
#note limitation of this script: needs file to exist beforehand | |
while ./sleep_until_modified.py testfile || sleep 1; do echo "diff detected" $( date -u --rfc-3339=seconds ) ; diff testfile.old testfile ; cp testfile testfile.old ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in a new terminal - for testing purposes | |
sleep 2 && echo "a new line" >> testfile | |
sleep 1 && touch testfile | |
sleep 1 && echo "another line" >> testfile | |
sleep 2 && touch testfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment