Difference between revisions of "Dropbox"

From ArchWiki
Jump to: navigation, search
m (This and the previous edit are to let dropbox+systemd users on laptops with wicd know that they can / should / may use systemd to to handle the daemon rather than starting and killing it manually)
(Undo revision 435180 by Py tosha (talk) - preventing restarting will not solve anything (or it's a completely separate issue))
 
(66 intermediate revisions by 34 users not shown)
Line 1: Line 1:
[[Category:Internet Applications]]
+
[[Category:Internet applications]]
 
[[de:Dropbox]]
 
[[de:Dropbox]]
 
[[it:Dropbox]]
 
[[it:Dropbox]]
 +
[[ja:Dropbox]]
 
[[ru:Dropbox]]
 
[[ru:Dropbox]]
 +
[[zh-CN:Dropbox]]
 
[[zh-TW:Dropbox]]
 
[[zh-TW:Dropbox]]
[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.
+
{{Related articles start}}
 +
{{Related|Synchronization and backup programs}}
 +
{{Related|Syncthing}}
 +
{{Related articles end}}
 +
 
 +
[https://www.dropbox.com Dropbox] is a file sharing system with 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.
  
 
== Installation ==
 
== Installation ==
  
{{AUR|dropbox}} can be installed from the [[Arch User Repository|AUR]]. Alternatively, {{AUR|dropbox-experimental}} is also available.
+
=== AUR ===
  
# After installing the package, you can start Dropbox from your application menu or run {{ic|dropboxd}} from the command-line. The client icon will appear in the system tray.
+
{{AUR|dropbox}} can be [[install]]ed. Alternatively, {{AUR|dropbox-experimental}} is also available. As a last resort, the Dropbox website has instructions for a [https://www.dropbox.com/install?os=lnx headless install via command line].
# 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.
+
 
 +
# After installing the package, you can start Dropbox from your application menu or run {{ic|dropbox}} 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.
 
# 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.
 
# 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".
 
# Press the "Finish and go to My Dropbox".
 
For [[KDE]] users, no further steps are required (it is enough to install the above {{AUR|dropbox}} 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 {{ic|dropbox.desktop}} file be placed in {{ic|~/.config/autostart}}.
 
  
 
=== Optional packages ===
 
=== Optional packages ===
  
 
*For a command-line interface, install {{AUR|dropbox-cli}} from the [[AUR]].
 
*For a command-line interface, install {{AUR|dropbox-cli}} from the [[AUR]].
*For integration with Nautilus, install {{AUR|nautilus-dropbox}} from the AUR. The Nautilus plugin will start Dropbox automatically.
+
*For integration with GNOME Files, install {{AUR|nautilus-dropbox}} from the AUR. The Files plugin will start Dropbox automatically.
*For integration with Nemo, install {{AUR|nemo-dropbox-git}} from the AUR.
+
*For integration with Nemo, install {{AUR|nemo-dropbox}} from the AUR.
 
*For integration with [[Thunar]], install {{AUR|thunar-dropbox}} from the AUR.
 
*For integration with [[Thunar]], install {{AUR|thunar-dropbox}} from the AUR.
 +
*For integration with [[Dolphin]], install {{pkg|dolphin-plugins}}
 
*For [[KDE]] users, there is a KDE client available: {{AUR|kfilebox}} from the AUR.
 
*For [[KDE]] users, there is a KDE client available: {{AUR|kfilebox}} from the AUR.
 +
*For integration with Caja, install {{AUR|caja-dropbox}} from the AUR.
  
=== Automatically starting Dropbox ===
+
== Automatically starting Dropbox ==
  
Dropbox can be automatically started by adding {{Ic|dropboxd}} to {{ic|~/.xinitrc}} (or {{ic|~/.config/openbox/autostart}}, depending on your setup). Alternatively, you can [[#Run as daemon with systemd|start it as a daemon]].
+
After installation, it is recommended to start Dropbox manually to configure it. If you open your Dropbox preferences, under the "General" tab there should be a "Start Dropbox on system startup" checkbox. Try checking this box and seeing if Dropbox starts automatically.
  
== Alternative to install: use the web interface ==
+
If that does not work, uncheck the box and use one of the following methods instead:
  
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.
+
=== Starting with your WM/DE ===
 +
 
 +
For [[KDE]] users, no further steps are required, 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 {{ic|dropbox.desktop}} file has been placed in {{ic|~/.config/autostart}}.
 +
 
 +
For [[Cinnamon]] users, it's recommended to start Dropbox client by configuring Startup Applications with a little delay (Cinnamon issue [https://github.com/linuxmint/Cinnamon/issues/4396 #4396]). Starting dropbox with systemd works, running in background, but there's is no icon on systray due to some Cinnamon bugs ([https://github.com/linuxmint/Cinnamon/issues/481 #481], [https://github.com/linuxmint/Cinnamon/issues/2846 #2846]).
 +
 
 +
If that does not work, you can start the Dropbox sync client along with your window manager by adding {{Ic|/usr/bin/dropbox &}} to your [[xinitrc]] (or {{ic|~/.config/openbox/autostart}}, depending on your setup).
 +
 
 +
=== Starting on boot with systemd ===
 +
 
 +
{{Note|If ''systemd'' keeps restarting Dropbox you should try to [[#Hack to stop Auto Update|disable Auto Update]] according to [https://www.dropboxforum.com/hc/en-us/community/posts/202917115-dropbox-will-not-start-under-systemd-on-linux Dropbox forum].}}
  
== Run as daemon with systemd ==
+
To have Dropbox automatically start when your system boots, simply [[enable]] the systemd service, passing your username as the instance identifier. The service unit to be enabled takes the format {{ic|dropbox@''username''}}.
  
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 {{ic|/etc/systemd/system/dropbox@.service}} to override the provided service file and specify the environment variable {{ic|DISPLAY}}:
+
By default, running the service does not give you an icon in the system tray because it does not know which X display to use. If you want to have tray support, you must [[systemd#Editing provided units|edit]] the provided service:
  
{{hc|/etc/systemd/system/dropbox@.service|<nowiki>
+
{{hc|# systemctl edit dropbox@''username''|<nowiki>
.include /usr/lib/systemd/system/dropbox@.service
+
 
[Service]
 
[Service]
 
Environment=DISPLAY=:0
 
Environment=DISPLAY=:0
 
</nowiki>}}
 
</nowiki>}}
  
Finally, to enable the daemon for your user, so that it will start at login:
+
=== Starting on login with systemd ===
# 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 ===
+
To have Dropbox automatically start when you log in, simply [[enable]] the [[systemd/User|user service]].
  
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:
+
If you want Dropbox to appear in your system tray, you will need to [[systemd#Editing provided units|edit]] the service unit so that it knows which X display the system tray is in:
 
+
{{hc|$HOME/.config/systemd/user/dropbox@.service|<nowiki>
+
[Unit]
+
Description=Dropbox as a systemd service
+
After=xorg.target
+
  
 +
{{hc|$ systemctl --user edit dropbox|<nowiki>
 
[Service]
 
[Service]
ExecStart=/home/your_user/.dropbox-dist/dropbox
+
Environment=DISPLAY=:0
ExecReload=/bin/kill -HUP $MAINPID
+
Environment=DISPLAY=%i
+
 
+
[Install]
+
WantedBy=mystuff.target
+
 
</nowiki>}}
 
</nowiki>}}
  
They you can start or enable it with:
+
== Accessing the files without installing a sync client ==
  
$ systemctl --user {start|enable} dropbox@:0.service
+
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.
 
+
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 {{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.}}
+
Alternatively, the [[AUR]] package {{AUR|droxi}} provides a command-line interface to Dropbox similar to the GNU {{ic|ftp}} client.
  
 
== Securing your Dropbox ==
 
== 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.
+
If you want to store sensitive data in your Dropbox, you should encrypt it before doing so. 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.
 
* 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.
Line 102: Line 107:
 
== Multiple Dropbox instances ==
 
== 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.
+
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 their directories synced by different Dropbox instances running on a single machine.
  
 
The basic principle and general how-to are described in the [http://www.dropboxwiki.com/Multiple_Instances_On_Unix Dropbox Wiki].
 
The basic principle and general how-to are described in the [http://www.dropboxwiki.com/Multiple_Instances_On_Unix 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 {{ic|/home/dropbox-personal}}, {{ic|/home/dropbox-work}}, and so on.}}
+
To summarize, you can setup new or additional instances with:
 
+
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.
+
  
 
{{bc|<nowiki>
 
{{bc|<nowiki>
#!/bin/bash
+
mkdir /path/to/.dropbox-alt-1
 +
HOME=/path/to/.dropbox-alt-1 /usr/bin/dropbox start -i
 +
</nowiki>}}
  
#*******************************
+
Once that is done, stop any Dropbox instance still running and start them like this:
# Multiple dropbox instances
+
#*******************************
+
  
dropboxes=(.dropbox-personal .dropbox-work)
+
{{bc|<nowiki>
                                                                                                       
+
HOME=/path/to/.dropbox-alt-1 /path/to/.dropbox-alt-1/.dropbox-dist/dropboxd
for dropbox in ${dropboxes[@]}; do
+
HOME=/path/to/.dropbox-alt-2 /path/to/.dropbox-alt-2/.dropbox-dist/dropboxd
    if ! [ -d $HOME/$dropbox ];then
+
        mkdir $HOME/$dropbox
+
    fi
+
    HOME=$HOME/$dropbox/ /opt/dropbox/dropbox start -i &
+
done
+
 
</nowiki>}}
 
</nowiki>}}
 +
 +
Pay attention to use different {{ic|.../.dropbox-dist/dropboxd}} binaries. Even when setting a custom HOME value, the {{ic|/opt/dropbox/dropbox}} or {{ic|/opt/dropbox/dropboxd}} wrappers allow only one instance and when started they will kill the one already running.
  
 
== Dropbox on laptops ==
 
== Dropbox on laptops ==
Line 137: Line 137:
 
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.
  
  ExecUpPost="''any other code''; su -c 'DISPLAY=:0 /usr/bin/dropboxd &' ''your_user'' || true"
+
  ExecUpPost="''any other code''; su -c 'DISPLAY=:0 /usr/bin/dropbox &' ''your_user'' || true"
 
  ExecDownPre="''any other code''; killall dropbox"
 
  ExecDownPre="''any other code''; killall dropbox"
  
Line 144: Line 144:
 
=== Using NetworkManager ===
 
=== Using NetworkManager ===
  
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}}.
+
If you have connectivity problem with [[NetworkManager]], try using a [[NetworkManager#Network services with NetworkManager dispatcher|dispatcher script]]: {{AUR|networkmanager-dispatcher-dropbox}}{{Broken package link|{{aur-mirror|networkmanager-dispatcher-dropbox}}}} or {{AUR|networkmanager-dispatcher-dropbox-systemd}}{{Broken package link|{{aur-mirror|networkmanager-dispatcher-dropbox-systemd}}}}.
  
 
=== Using wicd ===
 
=== Using wicd ===
Line 150: Line 150:
 
Create /etc/wicd/scripts/postconnect/dropbox:
 
Create /etc/wicd/scripts/postconnect/dropbox:
 
  #!/usr/bin/env bash
 
  #!/usr/bin/env bash
  su -c 'DISPLAY=:0 /usr/bin/dbus-launch dropboxd &' your_username
+
  su -c 'DISPLAY=:0 /usr/bin/dbus-launch dropbox &' your_username
  
 
or, if you use dropbox with systemd:
 
or, if you use dropbox with systemd:
Line 166: Line 166:
 
  systemctl stop dropbox@<user>
 
  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.}}
+
Do not forget to make the above scripts executable.
  
 
== Troubleshooting ==
 
== Troubleshooting ==
Line 172: Line 172:
 
=== Dropbox keeps saying Downloading files ===
 
=== 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 [[https://bbs.archlinux.org/viewtopic.php?id=153368 forums]]. To resolve the problem pay attention to your entry in {{ic|/etc/fstab}}. Avoid spaces in the mount path and set write permissions with the "default_permissions" option:
+
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 [https://bbs.archlinux.org/viewtopic.php?id=153368 forums]. To resolve the problem pay attention to your entry in {{ic|/etc/fstab}}. Avoid spaces in the mount path and set write permissions with the "default_permissions" option:
  
 
  UUID=01CD2ABB65E17DE0 /run/media/username/Windows ntfs-3g uid=username,gid=users,default_permissions 0 0
 
  UUID=01CD2ABB65E17DE0 /run/media/username/Windows ntfs-3g uid=username,gid=users,default_permissions 0 0
Line 178: Line 178:
 
=== Change the Dropbox location from the installation wizard ===
 
=== 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 {{ic|/home/username/Dropbox}}. In this case when the window for changing the path is shown , hit {{ic|Ctrl+l}}, enter the location (e.g. /mnt/data/Dropbox) and click on the '"Choose" or "Open" button.
+
Some users experience the problem during setting-up Dropbox that they cannot select a Dropbox folder other than {{ic|/home/username/Dropbox}}. In this case when the window for changing the path is shown , hit {{ic|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 ===
 
=== 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 {{ic|$BROWSER}} variable which Dropbox requires. You can check that by
+
Several file managers such as Thunar, GNOME Files 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 not working, then it is likely you have not set the {{ic|$BROWSER}} variable which Dropbox requires. See [[Environment variables]] for details.
 
+
$ echo $BROWSER
+
 
+
To set your {{ic|$BROWSER}} variable open {{ic|~/.profile}} and replace {{ic|chromium}} with your default browser:
+
 
+
if [ -n "$DISPLAY" ]; then
+
        BROWSER=chromium
+
fi
+
  
 
=== Connecting... ===
 
=== Connecting... ===
Line 200: Line 192:
 
* {{ic|cp ~/.config/autostart/dropbox.desktop ~/.config/autostart/dropbox-delayed.desktop}}
 
* {{ic|cp ~/.config/autostart/dropbox.desktop ~/.config/autostart/dropbox-delayed.desktop}}
 
* Prevent dropbox from doing a standard autostart by unchecking Dropbox - Preferences - General - Start Dropbox on system startup. This removes {{ic|~/.config/autostart/dropbox.desktop}}.
 
* Prevent dropbox from doing a standard autostart by unchecking Dropbox - Preferences - General - Start Dropbox on system startup. This removes {{ic|~/.config/autostart/dropbox.desktop}}.
* 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.
+
* Edit {{ic|~/.config/autostart/dropbox-delayed.desktop}} and replace {{ic|1=Exec=dropbox}} with {{ic|1=Exec=bash -c "sleep ''timeout'' && dropbox"}}. Tweak the ''timeout'' parameter, the value of {{ic|3}} is a good start.
  
 
=== 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 226: Line 218:
  
 
A detailed story of such an occurrence can be found in the [https://bbs.archlinux.org/viewtopic.php?pid=973458 forums]. Make sure there is enough space available before launching Dropbox.
 
A detailed story of such an occurrence can be found in the [https://bbs.archlinux.org/viewtopic.php?pid=973458 forums]. Make sure there is enough space available before launching Dropbox.
 +
 +
Another case is when the root partition is full:
 +
 +
OperationalError: database or disk is full
 +
 +
Check to see the available space on partitions with {{ic|df}}.
  
 
==== Locale caused errors ====
 
==== Locale caused errors ====
  
Try starting {{Ic|dropboxd}} with this code:
+
Try starting {{Ic|dropbox}} with this code:
  
 
  LANG=$LOCALE
 
  LANG=$LOCALE
  dropboxd
+
  dropbox
  
 
(You can also use a different value for LANG; it must be in the format "en_US.UTF-8")
 
(You can also use a different value for LANG; it must be in the format "en_US.UTF-8")
Line 250: Line 248:
 
to {{ic|/etc/sysctl.d/99-sysctl.conf}} and then reload the kernel parameters
 
to {{ic|/etc/sysctl.d/99-sysctl.conf}} and then reload the kernel parameters
  
  # sysctl -p /etc/sysctl.d/99-sysctl.conf
+
  # sysctl --system
  
 
=== Proxy settings ===
 
=== Proxy settings ===
Line 256: Line 254:
 
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)
  
{{bc|<nowiki>env http_proxy=http://your.proxy.here:port /usr/bin/dropboxd</nowiki>}}
+
{{bc|<nowiki>env http_proxy=http://your.proxy.here:port /usr/bin/dropbox</nowiki>}}
  
 
or
 
or
Line 262: Line 260:
 
{{bc|<nowiki>
 
{{bc|<nowiki>
 
export http_proxy=http://your.proxy.here:port
 
export http_proxy=http://your.proxy.here:port
/usr/bin/dropboxd
+
/usr/bin/dropbox
 
</nowiki>}}
 
</nowiki>}}
  
 
{{Note|Dropbox will only use proxy settings of the form {{ic|<nowiki>http://your.proxy.here:port</nowiki>}}, not {{ic|<nowiki>your.proxy.here:port</nowiki>}} as some other applications do.}}
 
{{Note|Dropbox will only use proxy settings of the form {{ic|<nowiki>http://your.proxy.here:port</nowiki>}}, not {{ic|<nowiki>your.proxy.here:port</nowiki>}} as some other applications do.}}
  
== Alternatives ==
+
=== Hack to stop Auto Update ===
 
+
{{bc|<nowiki>
* [[Ubuntu One]] - {{Pkg|ubuntuone-client}}
+
rm -rf ~/.dropbox-dist
* [https://spideroak.com/ Spider Oak] - {{AUR|spideroak}}
+
install -dm0 ~/.dropbox-dist
* [http://kdropbox.deuteros.es/ KFileBox] - {{AUR|kfilebox}}
+
</nowiki>}}
* [https://www.wuala.com/ Wuala] - {{AUR|wuala}}
+

Latest revision as of 10:17, 20 May 2016

Dropbox is a file sharing system with 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

AUR

dropboxAUR can be installed. Alternatively, dropbox-experimentalAUR is also available. As a last resort, the Dropbox website has instructions for a headless install via command line.

  1. After installing the package, you can start Dropbox from your application menu or run dropbox from the command-line. The client icon will appear in the system tray.
  2. 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.
  3. Eventually a pop-up will ask you to log in to your Dropbox account or create a new account. Enter your credentials.
  4. 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.
  5. Press the "Finish and go to My Dropbox".

Optional packages

Automatically starting Dropbox

After installation, it is recommended to start Dropbox manually to configure it. If you open your Dropbox preferences, under the "General" tab there should be a "Start Dropbox on system startup" checkbox. Try checking this box and seeing if Dropbox starts automatically.

If that does not work, uncheck the box and use one of the following methods instead:

Starting with your WM/DE

For KDE users, no further steps are required, 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 has been placed in ~/.config/autostart.

For Cinnamon users, it's recommended to start Dropbox client by configuring Startup Applications with a little delay (Cinnamon issue #4396). Starting dropbox with systemd works, running in background, but there's is no icon on systray due to some Cinnamon bugs (#481, #2846).

If that does not work, you can start the Dropbox sync client along with your window manager by adding /usr/bin/dropbox & to your xinitrc (or ~/.config/openbox/autostart, depending on your setup).

Starting on boot with systemd

Note: If systemd keeps restarting Dropbox you should try to disable Auto Update according to Dropbox forum.

To have Dropbox automatically start when your system boots, simply enable the systemd service, passing your username as the instance identifier. The service unit to be enabled takes the format dropbox@username.

By default, running the service does not give you an icon in the system tray because it does not know which X display to use. If you want to have tray support, you must edit the provided service:

# systemctl edit dropbox@username
[Service]
Environment=DISPLAY=:0

Starting on login with systemd

To have Dropbox automatically start when you log in, simply enable the user service.

If you want Dropbox to appear in your system tray, you will need to edit the service unit so that it knows which X display the system tray is in:

$ systemctl --user edit dropbox
[Service]
Environment=DISPLAY=:0

Accessing the files without installing a sync client

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.

Alternatively, the AUR package droxiAUR provides a command-line interface to Dropbox similar to the GNU ftp client.

Securing your Dropbox

If you want to store sensitive data in your Dropbox, you should encrypt it before doing so. 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.

Setup EncFS with Dropbox

Follow the Wiki instructions to install EncFS.

Assuming you have set your Dropbox directory as ~/Dropbox:

Create a folder. Files you want synced to Dropbox will go in here.

$ mkdir ~/Private

Run the following and enter a password when asked:

$ encfs ~/Dropbox/Encrypted ~/Private

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 their directories synced by different Dropbox instances running on a single machine.

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

To summarize, you can setup new or additional instances with:

mkdir /path/to/.dropbox-alt-1
HOME=/path/to/.dropbox-alt-1 /usr/bin/dropbox start -i

Once that is done, stop any Dropbox instance still running and start them like this:

HOME=/path/to/.dropbox-alt-1 /path/to/.dropbox-alt-1/.dropbox-dist/dropboxd
HOME=/path/to/.dropbox-alt-2 /path/to/.dropbox-alt-2/.dropbox-dist/dropboxd

Pay attention to use different .../.dropbox-dist/dropboxd binaries. Even when setting a custom HOME value, the /opt/dropbox/dropbox or /opt/dropbox/dropboxd wrappers allow only one instance and when started they will kill the one already running.

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.

ExecUpPost="any other code; su -c 'DISPLAY=:0 /usr/bin/dropbox &' your_user || true"
ExecDownPre="any other code; killall dropbox"

Obviously, your_user has to be edited and 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

If you have connectivity problem with NetworkManager, try using a dispatcher script: networkmanager-dispatcher-dropboxAUR[broken link: archived in aur-mirror] or networkmanager-dispatcher-dropbox-systemdAUR[broken link: archived in aur-mirror].

Using wicd

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

#!/usr/bin/env bash
su -c 'DISPLAY=:0 /usr/bin/dbus-launch dropbox &' 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>

Do not forget to make the above scripts executable.

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:

UUID=01CD2ABB65E17DE0 /run/media/username/Windows ntfs-3g uid=username,gid=users,default_permissions 0 0

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, GNOME Files 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 not working, then it is likely you have not set the $BROWSER variable which Dropbox requires. See Environment variables for details.

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:

  • cp ~/.config/autostart/dropbox.desktop ~/.config/autostart/dropbox-delayed.desktop
  • Prevent dropbox from doing a standard autostart by unchecking Dropbox - Preferences - General - Start Dropbox on system startup. This removes ~/.config/autostart/dropbox.desktop.
  • Edit ~/.config/autostart/dropbox-delayed.desktop and replace Exec=dropbox with Exec=bash -c "sleep timeout && dropbox". Tweak the timeout parameter, the value of 3 is a good start.

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

Check permissions

Make sure that you own Dropbox's directories before running the application. This includes

  • ~/.dropbox - Dropbox's configuration directory
  • ~/Dropbox - Dropbox's download directory (default)

You can ensure this by changing their owner with chown -R.

This error could also be caused by /var being full.

Re-linking your account

Dropbox's FAQ suggests that this error may be caused by misconfiguration and is fixed by (re)moving the current configuration folder

# mv ~/.dropbox ~/.dropbox.old

and restarting Dropbox.

Errors caused by running out of space

A common error that might happen is that there is no more available space on your /tmp and /var partitions. If this happens, Dropbox will crash on startup with the following error in its log:

Exception: Not a valid FileCache file

A detailed story of such an occurrence can be found in the forums. Make sure there is enough space available before launching Dropbox.

Another case is when the root partition is full:

OperationalError: database or disk is full

Check to see the available space on partitions with df.

Locale caused errors

Try starting dropbox with this code:

LANG=$LOCALE
dropbox

(You can also use a different value for LANG; it must be in the format "en_US.UTF-8") This helps when running from a Bash script or Bash shell where /etc/rc.d/functions has been loaded

Filesystem monitoring problem

If you have a lot of files to sync in your Dropbox folder, you might get the following error:

Unable to monitor filesystem
Please run: echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches and restart Dropbox to correct the problem.

This can be fixed easily by adding

fs.inotify.max_user_watches = 100000

to /etc/sysctl.d/99-sysctl.conf and then reload the kernel parameters

# sysctl --system

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/dropbox

or

export http_proxy=http://your.proxy.here:port
/usr/bin/dropbox
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.

Hack to stop Auto Update

rm -rf ~/.dropbox-dist
install -dm0 ~/.dropbox-dist