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.
dropbox: accounts: - pat_hatherleigh_info - web_pkimber_net
Our standard for the names is to take the email address of the
Dropbox account and replace
e.g. firstname.lastname@example.org becomes
sls file into the
top.sls file for your server e.g:
'dropbox': - 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:
/home/web/repo/files/dropbox/pat_hatherleigh_info /home/web/opt/backup_dropbox_pat_hatherleigh_info.sh /etc/cron.d/dropbox /etc/supervisor/conf.d/dropbox_pat_hatherleigh_info
Each Dropbox account will need to be initialised. Log into your server:
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
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 https://www.dropbox.com/cli_link_nonce?nonce=f123abc123abc123abc123abc123abc1 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:
For the following, refer to your company Checklist and replace
email@example.com with your rsync.net Host address.
To check the rsync.net usage (by domain), create a script for in your
as follows. At your command prompt type the following:
Then type or paste the following 2 lines (Please note: the backslash before the asterisk is important:
#!/bin/bash ssh firstname.lastname@example.org 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
The dropbox configuration file will be called
dropbox_<email address with ‘@’ and ‘.’ replaced with ‘_’>
for example if your dropbox login is email@example.com 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:
This will probably report:
And then apply the configuration:
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.