Skip to content

Instantly share code, notes, and snippets.

@bguiz
Created July 10, 2014 00:28
Show Gist options
  • Save bguiz/51471fb388fd24a3be6c to your computer and use it in GitHub Desktop.
Save bguiz/51471fb388fd24a3be6c to your computer and use it in GitHub Desktop.
Runs dropbox at intervals, so as not to create too many deltas
#!/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