Created
July 10, 2014 00:28
-
-
Save bguiz/51471fb388fd24a3be6c to your computer and use it in GitHub Desktop.
Runs dropbox at intervals, so as not to create too many deltas
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/bash | |
# Runs dropbox at intervals, so as not to create too many deltas | |
SYNC_CHECK_INTERVAL=60 | |
SLEEP_INTERVAL=900 | |
while true ; do | |
echo "Dropbox watch loop" | |
dropbox start | |
while true ; do | |
status="$( dropbox status )" | |
if echo "$status" | grep -q -E 'Up to date' ; then | |
echo "Up to date" | |
break 1 | |
else | |
echo "Still waiting for sync" | |
sleep ${SYNC_CHECK_INTERVAL} | |
fi | |
done | |
echo "Sleeping" | |
dropbox stop | |
sleep ${SLEEP_INTERVAL} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment