[https://www.dropbox.com Dropbox] 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 {{ic|~/Dropbox}} folder, and they will automatically sync to your centralized repository.

[https://www.dropbox.com Dropbox] 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 {{ic|~/Dropbox}} folder, and they will automatically sync to your centralized repository.

Line 73:

Line 77:

{{Note|After a lot of trial and error I found that using {{ic|/usr/bin/dropboxd}} didn't start the service and it didn't show any error either (even when running it directly from the terminal worked fine). I believe it has to do that starting it that way systemd doesn't know which user is actually running the daemon.}}

{{Note|After a lot of trial and error I found that using {{ic|/usr/bin/dropboxd}} didn't start the service and it didn't show any error either (even when running it directly from the terminal worked fine). I believe it has to do that starting it that way systemd doesn't know which user is actually running the daemon.}}

−

−

== Without Nautilus (another way)==

−

−

{{Deletion|When nautilus is not found, dropbox calls [[xdg-open]] to open the folder. If you don't use nautilus, you probably don't have it installed, so this ugly hack is quite useless.}}

−

−

Another way to use Dropbox without Nautilus but with another file manager like Thunar or Pcmanfm is described below:

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 {{ic|/etc/rc.d/}} and to start it at boot via {{ic|/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.

−

* If you already have Nautilus installed but do not want to use it, don't modify the existing file under {{ic|/usr/bin}}, just change the {{ic|/usr/bin}} for {{ic|/opt/dropbox}} in the step 2 above, like this: {{Ic|$ 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 ==

== Securing your Dropbox ==

Line 153:

Line 133:

== Dropbox on laptops ==

== 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.

+

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. '''Try one of the methods described below first,''' if for some reason the problem remains, you may try one of these hackish solutions: [https://bbs.archlinux.org/viewtopic.php?pid=790905], [https://bbs.archlinux.org/viewtopic.php?pid=1012343#p1012343].

+

+

{{Note|When using any of these methods, you need to prevent Dropbox from doing a standard autostart by unchecking ''Dropbox - Preferences - General - Start Dropbox on system startup''. This prevents Dropbox from creating the {{ic|~/.config/autostart/dropbox.desktop}} file and thus from starting twice.}}

=== Using netctl ===

=== Using netctl ===

For [[netctl]], use {{ic|ExecUpPost}} and {{ic|ExecDownPre}} respectively in every network profile you use, or for example in {{ic|/etc/netctl/interfaces/wlan0}} to start Dropbox automatically whenever profile on {{ic|wlan0}} is active. Add '|| true' to your command to make sure [[netctl]] will bring up your profile, although Dropbox fails to start.

For [[netctl]], use {{ic|ExecUpPost}} and {{ic|ExecDownPre}} respectively in every network profile you use, or for example in {{ic|/etc/netctl/interfaces/wlan0}} to start Dropbox automatically whenever profile on {{ic|wlan0}} is active. Add '|| true' to your command to make sure [[netctl]] will bring up your profile, although Dropbox fails to start.

Obviously, {{ic|your_user}} has to be edited and {{ic|any other code;}} can be omitted if you do not have any. The above will make sure that Dropbox is running only if there is a network profile active.

+

Obviously, {{ic|''your_user''}} has to be edited and {{ic|''any other code'';}} can be omitted if you do not have any. The above will make sure that Dropbox is running only if there is a network profile active.

=== Using NetworkManager ===

=== Using NetworkManager ===

−

If you have connectivity problem with [[NetworkManager]], [https://bbs.archlinux.org/viewtopic.php?pid=790905, this thread] on forum should be useful. Another good script to solve the problem, can be found [https://bbs.archlinux.org/viewtopic.php?pid=1012343#p1012343 here].

+

If you have connectivity problem with [[NetworkManager]], try using a [[NetworkManager#Network services with NetworkManager dispatcher|dispatcher script]]: {{AUR|networkmanager-dispatcher-dropbox}} or {{AUR|networkmanager-dispatcher-dropbox-systemd}}.

+

+

=== Using wicd ===

+

+

Create /etc/wicd/scripts/postconnect/dropbox:

+

#!/usr/bin/env bash

+

su -c 'DISPLAY=:0 /usr/bin/dbus-launch dropboxd &' your_username

+

+

or, if you use dropbox with systemd:

+

+

#!/usr/bin/env bash

+

systemctl restart dropbox@<user>

+

+

Create /etc/wicd/scripts/postdisconnect/dropbox:

+

#!/usr/bin/env bash

+

killall dropbox

+

+

or, if you use dropbox with systemd:

+

+

#!/usr/bin/env bash

+

systemctl stop dropbox@<user>

+

+

{{Note|If you use PCManFM as your file manager, Dropbox will use 'xdg-open' calls pcmanfm to open the Dropbox folder.However, without a dbus session, you can not use Trash in PCManFM. You should refer to [[Dbus]] and [[General Troubleshooting#Session permissions]]to edit your ~/.xinitrc based on /etc/skel/.xinitrc to start a D-Bus session before your launch any other program in ~/.xinitrc. Do use 'dbus-launch dropboxd' instead of just 'dropboxd' in wicd postconnect script. otherwise pcmanfm launched by clicking dropbox icon can not use the Trash.}}

== Troubleshooting ==

== Troubleshooting ==

Line 194:

Line 198:

=== Connecting... ===

=== Connecting... ===

−

{{Note|It seems that this issue has been fixed in later versions of dropbox (sometime before 1.6.0-2). It might be reasonable to test before installing one of the following scripts}}

+

It may happen that Dropbox cannot connect successfully because it was loaded before an internet connection was established. This can happen on wireless connections, or fast loading machines on wired networks. The best solution to this problem, for wired and wireless connections, is [[#Dropbox on laptops]] which will ensure that Dropbox is started only after the connection is established.

−

{{Poor writing|[[#Dropbox on Laptops|Dropbox on laptops]] is better workarround}}

−

−

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 {{ic|/opt/dropbox/dropboxd}} needs to be replaced with the following:

−

−

#!/bin/sh

−

−

# Copyright 2008 Evenflow, Inc., 2010 Dropbox

−

#

−

# Environment script for the dropbox executable.

−

−

start_dropbox() {

−

PAR=$(dirname $(readlink -f $0))

−

OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH

−

LD_LIBRARY_PATH=$PAR:$LD_LIBRARY_PATH

−

−

TMP1=$(ps ax|grep dropbox|grep -v grep)

−

if [ -n "$TMP1" ]; then

−

kill -9 $(pidof dropbox) >/dev/null 2>&1

−

fi

−

exec $PAR/dropbox $@ &

−

}

−

−

do_dropbox() {

−

start_dropbox >/dev/null 2>&1

−

while [ 1 ]; do

−

sleep 5

−

ERROR="$(net_test)"

−

if [ -n "$ERROR" ]; then

−

LAST_ERROR=1

−

else

−

if [ -n "$LAST_ERROR" ]; then

−

# Connection seems to be up but last cycle was down

−

LAST_ERROR=""

−

start_dropbox >/dev/null 2>&1

−

fi

−

fi

−

done

−

}

−

−

net_test() {

−

TMP1="$(ip addr |grep "inet " |grep -v "127.0.0.1")"

−

[ -z "$TMP1" ] && echo "error"

−

}

−

−

do_dropbox

−

Following is an alternative script that will check for an actual Internet connection by using {{Pkg|curl}} to check if any entry in a list of hosts and IP addresses is available.

+

An alternative solution, for those not using netctl or NetworkManager, is to delay the startup of dropbox:

−

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:

* Edit {{ic|~/.config/autostart/dropbox-delayed.desktop}} and replace {{ic|1=Exec=dropboxd}} with {{ic|1=Exec=bash -c "sleep ''timeout'' && dropboxd"}}. Tweak the ''timeout'' parameter, the value of {{ic|3}} is a good start.

−

−

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).

−

−

#!/bin/bash

−

−

# Copyright 2008 Evenflow, Inc., 2010 Dropbox

−

#

−

# Environment script for the dropbox executable.

−

−

WAIT_TIME=5 #initial time to wait between checking the internet connection

−

#HOSTS="www.google.com www.wikipedia.org 8.8.8.8 208.67.222.222"

−

HOSTS="www.google.com www.wikipedia.org "

−

−

PAR=$(dirname $(readlink -f $0))

−

OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH

−

LD_LIBRARY_PATH=$PAR${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH

−

−

#non-zero exit code iff none of the hosts could be reached

−

check_net() {

−

local ret=1

−

for i in $HOSTS; do

−

#ping -w2 -c2 $i > /dev/null 2>&1 && ret=0 && break

−

curl -o /dev/null $i > /dev/null 2>&1 && ret=0 && break

−

done

−

echo $ret

−

}

−

−

#if dropbox is running; kill it. Then start dropbox

−

start_dropbox() {

−

local tmp=$(ps ax|grep -E "[0-9] $PAR/dropbox"|grep -v grep)

−

if [ -n "$tmp" ]; then

−

kill -9 $(pidof dropbox) > /dev/null 2>&1

−

fi

−

exec $PAR/dropbox $@ > /dev/null 2>&1 &

−

}

−

−

#loop over: start dropbox iff check_net returns 0

−

#loop (and with it, the entire script) terminates when dropbox has been restarted,

−

#+ or the waiting time has exeeded 1500 seconds (it grows 50% with each iteration of the loop)

−

attempt_startup() {

−

while [ $WAIT_TIME -lt 1500 ] ; do

−

if [ $(check_net) -eq 0 ]; then

−

start_dropbox

−

exit

−

fi

−

sleep $WAIT_TIME

−

#WAIT_TIME=$(($WAIT_TIME+$WAIT_TIME/2))

−

let "WAIT_TIME += WAIT_TIME/2"

−

done

−

}

−

−

start_dropbox

−

attempt_startup &

−

−

{{Tip|When you update Dropbox via your preferred AUR helper, the file will (usually) be reverted to the default one. You can prevent this with {{ic|chattr +i /opt/dropbox/dropboxd}} which will make the file immutable. To reverse this action simply use {{ic|chattr -i /opt/dropbox/dropboxd}}. }}

=== Dropbox does not start - "This is usually because of a permission error" ===

=== Dropbox does not start - "This is usually because of a permission error" ===

Line 351:

Line 252:

fs.inotify.max_user_watches = 100000

fs.inotify.max_user_watches = 100000

−

to {{ic|/etc/sysctl.conf}} and then reload the kernel parameters

+

to {{ic|/etc/sysctl.d/99-sysctl.conf}} and then reload the kernel parameters

−

# sysctl -p

+

# sysctl --system

=== Proxy settings ===

=== Proxy settings ===

The easiest way to set Dropbox's proxy settings is by defining them manually in the Proxies tab of the Preferences window. Alternatively, you can also set it to 'Auto-detect' and then export your proxy server to the http_proxy env variable prior to starting Dropbox (HTTP_PROXY is also usable)

The easiest way to set Dropbox's proxy settings is by defining them manually in the Proxies tab of the Preferences window. Alternatively, you can also set it to 'Auto-detect' and then export your proxy server to the http_proxy env variable prior to starting Dropbox (HTTP_PROXY is also usable)

Revision as of 14:43, 13 December 2013

Dropbox 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.

Installation

After installing the package, you can start Dropbox from your application menu or run dropboxd from the command-line. The client icon will appear in the system tray.

A pop-up will notify you that Dropbox is running from an unsupported location. Click on Don't ask again since you know that you have installed it from AUR rather than from the official homepage.

Eventually a pop-up will ask you to log in to your Dropbox account or create a new account. Enter your credentials.

After some time you will see a "Welcome to Dropbox" pop-up, which will give you the opportunity to view a short tour of Dropbox.

Press the "Finish and go to My Dropbox".

For KDE users, no further steps are required (it is enough to install the above dropboxAUR package from the AUR), as KDE saves running applications when logging out and restarts them automatically. Similarly for Xfce users, dropbox will be restarted automatically next time you login since the dropbox.desktop file be placed in ~/.config/autostart.

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.

Run as daemon with systemd

Recent versions of Dropbox come with a systemd service file. By default running Dropbox as a daemon does not give you an icon in the system tray, but syncs your files and folders in the background. If you want to have tray support, create /etc/systemd/system/dropbox@.service to override the provided service file and specify the environment variable DISPLAY:

Finally, to enable the daemon for your user, so that it will start at login:

# systemctl enable dropbox@<user>

Note that you have to manually start Dropbox the first time after installation, so that it runs through the login and setup screen. Further, you need to uncheck the option Start Dropbox on system startup in order to prevent Dropbox from being started twice. The daemon can then be used subsequently.

Run as a daemon with systemd user

If you have followed the systemd/User wiki page, you probably want to start dropbox only when you log in or launch your WM/DE. The solution in that case is to create a service in your home directory instead of using the sysadmin account:

That way you can easily start it in your main display (likely :0) or in another one, without having to hard code it.

Note: After a lot of trial and error I found that using /usr/bin/dropboxd didn't start the service and it didn't show any error either (even when running it directly from the terminal worked fine). I believe it has to do that starting it that way systemd doesn't know which user is actually running the daemon.

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.

Your secure folder is ready for use; creating any file inside ~/Private will automatically encrypt it into ~/Dropbox/Encrypted, which will then be synced to your cloud storage.

To mount your EncFS folder on every boot, follow the instructions in the EncFS wiki page.

Tip: Consider using the ENCFS6_CONFIG variable and moving the .encfs6.xml file to another location (like a USB stick), to help ensure that your encrypted data and the means to realistically decrypt it do not exist together online.

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. Try one of the methods described below first, if for some reason the problem remains, you may try one of these hackish solutions: [1], [2].

Note: When using any of these methods, you need to prevent Dropbox from doing a standard autostart by unchecking Dropbox - Preferences - General - Start Dropbox on system startup. This prevents Dropbox from creating the ~/.config/autostart/dropbox.desktop file and thus from starting twice.

Using netctl

For netctl, use ExecUpPost and ExecDownPre respectively in every network profile you use, or for example in /etc/netctl/interfaces/wlan0 to start Dropbox automatically whenever profile on wlan0 is active. Add '|| true' to your command to make sure netctl will bring up your profile, although Dropbox fails to start.

Note: If you use PCManFM as your file manager, Dropbox will use 'xdg-open' calls pcmanfm to open the Dropbox folder.However, without a dbus session, you can not use Trash in PCManFM. You should refer to Dbus and General Troubleshooting#Session permissionsto edit your ~/.xinitrc based on /etc/skel/.xinitrc to start a D-Bus session before your launch any other program in ~/.xinitrc. Do use 'dbus-launch dropboxd' instead of just 'dropboxd' in wicd postconnect script. otherwise pcmanfm launched by clicking dropbox icon can not use the Trash.

Troubleshooting

Dropbox keeps saying Downloading files

But in fact now files are synced with your box. This problem is likely to appear when your Dropbox folder is located on a NTFS partition whose mount path contains spaces, or permissions are not set for that partition. See more in the [forums]. To resolve the problem pay attention to your entry in /etc/fstab. Avoid spaces in the mount path and set write permissions with the "default_permissions" option:

Change the Dropbox location from the installation wizard

Some users experience the problem during setting-up Dropbox that they cannot select a Dropbox folder other than /home/username/Dropbox. In this case when the window for changing the path is shown , hit Ctrl+l, enter the location (e.g. /mnt/data/Dropbox) and click on the '"Choose" or "Open" button.

Context menu entries in file manager do not work

Several file managers such as Thunar, Nautilus or its fork Nemo come with extensions that provide context menu entries for files and folders inside your Dropbox. Most of them will result in a browser action such as opening the file or folder in dropbox.com or sharing the link. If you experience these entries to not working, then you are likely to have not set the $BROWSER variable which Dropbox requires. You can check that by

$ echo $BROWSER

To set your $BROWSER variable open ~/.profile and replace chromium with your default browser:

if [ -n "$DISPLAY" ]; then
BROWSER=chromium
fi

Connecting...

It may happen that Dropbox cannot connect successfully because it was loaded before an internet connection was established. This can happen on wireless connections, or fast loading machines on wired networks. The best solution to this problem, for wired and wireless connections, is #Dropbox on laptops which will ensure that Dropbox is started only after the connection is established.

An alternative solution, for those not using netctl or NetworkManager, is to delay the startup of dropbox:

Proxy settings

The easiest way to set Dropbox's proxy settings is by defining them manually in the Proxies tab of the Preferences window. Alternatively, you can also set it to 'Auto-detect' and then export your proxy server to the http_proxy env variable prior to starting Dropbox (HTTP_PROXY is also usable)

env http_proxy=http://your.proxy.here:port /usr/bin/dropboxd

or

export http_proxy=http://your.proxy.here:port
/usr/bin/dropboxd

Note: Dropbox will only use proxy settings of the form http://your.proxy.here:port, not your.proxy.here:port as some other applications do.