I would like to 'manually' force dropbox to sync at certain times (eg at regular, daily intervals using cron, as part of a larger backup script). My goal is to substitute the dropbox daemon with single "sync" command invocations at only the times that I control.
Looking at the documentation for the dropbox
command on Ubuntu, I only see a way to start/stop the daemon, but not to force it to sync.
Is there a lower level api available that can accomplish this?
Best Answer
Using @Rat2000's suggestion, I did this. In one terminal,
In another terminal:
The first terminal shows approximately the following output:
So we can define a script, using
expect
, to do a one-time dropbox sync at controlled times, assuming that the dameon does not report "Idle" until it has finished syncing.Edit:
This solution seems to work for me:
Notes:
Depending on your Dropbox release you might have to replace
with
To reduce the impact on system performance you can experiment with utilities such as nice, ionice, and nocache, e.g.:
Setting the script up with
anacron
Of course, I schedule this script to run via anacron, like this: