Last active
December 30, 2015 00:19
-
-
Save lwzm/7749014 to your computer and use it in GitHub Desktop.
auto run something whith inotiry
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
#!/bin/sh | |
DUMP_FILE="dump" | |
while inotifywait -e modify,attrib $DUMP_FILE; do | |
while lsof $DUMP_FILE; do | |
echo "waiting..." && sleep 1 | |
done | |
cp $DUMP_FILE $DUMP_FILE.$(date "+%Y-%m-%d--%T") | |
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
while find . -name "*.as" | inotifywait --fromfile - >dev/null 2>&1; do | |
date; | |
sleep 0.1; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment