Backup Dropbox

To set-up a server for backing up DropBox accounts.

Set-up your gpg keys (see Cloud Server).

Create a pillar file listing the name of the accounts you want to backup e.g. sites/dropbox.sls:

    - pat_hatherleigh_info
    - web_pkimber_net


Our standard for the names is to take the email address of the Dropbox account and replace @ and . with _ e.g. becomes pat_hatherleigh_info.

Include this sls file into the top.sls file for your server e.g:

  - global.gpg
  - global.users
  - sites.dropbox

Apply the salt states to your server. This will create folders, backup scripts, cron and supervisor tasks for each account e.g:



Each Dropbox account will need to be initialised. Log into your server:

sudo -i

Find the log file for the supervisor task for your account:

ls -l /var/log/supervisor/


If the file is empty (0 bytes), then log into the supervisor console (supervisorctl) and check the status of the process. If you see this message, can't find command '/home/web/.dropbox-dist/dropboxd' then DropBox was probably installed after the supervisor script was created. Just re-start the process to resolve this issue.

Follow the file e.g:

tail -f /var/log/supervisor/dropbox_pat_hatherleigh_infok-stdout---supervisor-NI0cjP.log
# sample output
This computer isn't linked to any Dropbox account...
Please visit to link this device.

Open a private (or incognito session) in a browser . Log into the DropBox account you want to sync and paste in the URL.

The script will tell you that the account is linked e.g:

This computer is now linked to Dropbox. Welcome Pat

To check the sync, look in the following folder (update folder names as required):

sudo -i -u web
ls -l /home/web/repo/files/dropbox/pat_hatherleigh_info/Dropbox/

To initialise the backup run the backup script with the full argument e.g:

/home/web/opt/ full


To restore a document or folder, follow the example commands in Duplicity.



For the following, refer to your company Checklist and replace with your Host address.

To check the usage (by domain), create a script for in your ~/bin as follows. At your command prompt type the following:

gedit ~/bin/rsync-usage

Then type or paste the following 2 lines (Please note: the backslash before the asterisk is important:

ssh du -sh \*

Save the file and close gedit. Then type the following at your command prompt:

chmod 755 ~/bin/rsync-usage

Now to get the analysis of usage on our rsync account, you can type:


Stop dropbox running

If salt is used to configure dropbox on a server (“sites.dropbox” from the server config of top.sls), removing it from the salt configuration does remove it from the server.

To remove from the server log on the server and change to the superviser configuration directory

cd /etc/superviser/conf.d

The dropbox configuration file will be called

dropbox_<email address with ‘@’ and ‘.’ replaced with ‘_’>

for example if your dropbox login is the file will be called:


Delete this file using:

sudo rm dropbox_web_hatherleigh_info

Or comment the contents of the file by putting # at the beginning of each line using your favourite editor.

Then get the supervisor daemon to reread the configuration using:

supervisorctl reread

This will probably report:

dropbox_web_hatherleigh_info: disappeared

And then apply the configuration:

supervisorctl update

This will stop the processes respawning once stopped but will not stop existing processes.

Check the existing dropbox processes using the command:

ps -ef | grep dropbox | grep -v grep

Terminate these using your favourite process termination method e.g.:

pkill -f dropbox

Verify that app processes are terminated using the above process status command.