Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This script looks for changes in Dropbox folder. Upon any change, waits for the status to be Up to date. When it's fully synced, starts a build process (/app/build.bin).
#!/bin/sh
uptodate () {
# returns 1 if up to date, 0 otherwise.
python /root/dropbox.py status | grep "Up to date" |wc -l
}
build_after_uptodate() {
while [ "$(uptodate)" != "1" ]; do
sleep 1
done
echo "Build now!"
/app/build.bin
}
while true #run indefinitely
do
if [ -d "/root/Dropbox" ]; then
inotifywait -r -e modify,attrib,close_write,move,create,delete ~/Dropbox && build_after_uptodate
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment