Revision as of 19:08, 21 August 2012

zh-TW:DropboxDropbox is a file sharing system that recently introduced a GNU/Linux client. Use it to transparently sync files across computers and architectures. Simply drop files into your ~/Dropbox folder, and they will automatically sync to your centralized repository.

For KDE users, there is a KDE client available: kfileboxAUR from the AUR.

Automatically Starting Dropbox

Dropbox can be automatically started by adding dropboxd to ~/.xinitrc (or ~/.config/openbox/autostart, depending on your setup). Alternatively, you can start it as a daemon.

Alternative to install: use the web interface

If all you need is basic access to the files in your Dropbox, you can use the web interface at https://www.dropbox.com/ to upload and download files to your Dropbox. This can be a viable alternative to running a Dropbox daemon and mirroring all the files on your own machine.

Daemon

To run Dropbox as a daemon similarly to sshd or vsftpd, simply do one of the following:

4. Click on the Dropbox tray icon to open your Dropbox folder in Thunar.

Note: In this way there is no need to create a Dropbox daemon in /etc/rc.d/ and to start it at boot via /etc/rc.conf or to make it start via your session manager: just leave the "Start Dropbox on system startup" option flagged in the Preferences window.

Note: If you already have Nautilus installed but do not want to use it, neither modify the existing file under /usr/bin, just change the /usr/bin for /opt/dropbox in the step 2 above, like this: $ sudo touch /opt/dropbox/nautilus && sudo chmod +x /opt/dropbox/nautilus && sudo nano /opt/dropbox/nautilus. Dropbox will look in this path first!

Securing Your Dropbox

If you want to store sensitive data in your Dropbox, you should encrypt it before. Syncing to Dropbox is encrypted, but all files are (for the time being) stored on the server unencrypted just as you put them in your Dropbox.

Dropbox works with TrueCrypt, and after you initially uploaded the TrueCrypt volume to Dropbox, performance is quite okay, because Dropbox has a working binary diff.

Another possibility is to use EncFS, which has the advantage that all files are encrypted separately, i.e. you do not have to determine in advance the size of the content you want to encrypt and your encrypted directory grows and shrinks while you add/delete/modify files in it. You can also mount an encrypted volume at startup using the -S option of encfs to avoid having to input the passphrase, but note that your encrypted files are not secure from someone who has direct access to your computer.

Multiple Dropbox Instances

If you need to separate or distinguish your data, personal and work usage for example, you can subscribe to Dropbox with different email addresses and have multiple directories synced to different instances.

The basic principle and general how-to are described in the Dropbox Wiki.

Note: When dealing with multiple instances you have to select the Dropbox destination folder, which the Dropbox installer asks in the last step; usage examples may be /home/dropbox-personal, /home/dropbox-work, and so on.

For convenience, here is a script that I use to accomplish the task: just add a dir in the "dropboxes" list to have another instance of Dropbox, referring to the dir, loaded at script startup.

Dropbox on Laptops

Dropbox itself is pretty good at dealing with connectivity problems. If you have a laptop and roam between different network environments, Dropbox will have problems reconnecting if you do not restart it. The easiest way to solve this with netcfg is to use POST_UP and PRE_DOWN.

Known Issues

Connecting...

It may happen that Dropbox cannot connect successfully because it was loaded before an Internet connection was established. To solve the problem the content of the file /opt/dropbox/dropboxd needs to be replaced with the following:

Following is an alternative script that will check for an actual Internet connection by using curl to check if any entry in a list of hosts and IP addresses is available.
If none of the specified hosts are available, the script will wait and try again (albeit not forever).
The way the script increments the waiting time is quite messy, but the logic goes like this:

Start with a wait time of 5 seconds.

Multiply by 1.5.

Do this as long as the wait time is less than 1500 seconds (25 minutes), and the check_net()
function returns non-zero values (failure).