https://wiki.archlinux.org/api.php?action=feedcontributions&user=Bazmonkey&feedformat=atomArchWiki - User contributions [en]2024-03-28T17:25:06ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Dropbox&diff=267441Dropbox2013-07-21T17:15:46Z<p>Bazmonkey: /* Setup EncFS with Dropbox */</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[[de:Dropbox]]<br />
[[it:Dropbox]]<br />
[[ru:Dropbox]]<br />
[[zh-TW:Dropbox]]<br />
[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.<br />
<br />
== Installation ==<br />
<br />
{{AUR|dropbox}} can be installed from the [[Arch User Repository|AUR]]. Alternatively, {{AUR|dropbox-experimental}} is also available.<br />
<br />
# 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.<br />
# 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.<br />
# Eventually a pop-up will ask you to log in to your Dropbox account or create a new account. Enter your credentials.<br />
# 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.<br />
# Press the "Finish and go to My Dropbox".<br />
<br />
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}}.<br />
<br />
=== Optional packages ===<br />
<br />
*For a command-line interface, install {{AUR|dropbox-cli}} from the [[AUR]].<br />
*For integration with Nautilus, install {{AUR|nautilus-dropbox}} from the AUR. The Nautilus plugin will start Dropbox automatically.<br />
*For integration with Nemo, install {{AUR|nemo-dropbox-git}} from the AUR.<br />
*For integration with [[Thunar]], install {{AUR|thunar-dropbox}} from the AUR.<br />
*For [[KDE]] users, there is a KDE client available: {{AUR|kfilebox}} from the AUR.<br />
<br />
=== Automatically starting Dropbox ===<br />
<br />
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]].<br />
<br />
== Alternative to install: use the web interface ==<br />
<br />
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.<br />
<br />
== Run as daemon with systemd ==<br />
<br />
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, then you have to copy the service file to {{ic|/etc/systemd/system/dropbox@.service}} and add the environment variable.<br />
<br />
# echo ".include /usr/lib/systemd/system/dropbox@.service<br />
[Service]<br />
Environment=DISPLAY=:0" > /etc/systemd/system/dropbox@.service<br />
<br />
Finally, to enable the daemon for your user, so that it will start at login:<br />
# systemctl enable dropbox@<user><br />
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.<br />
<br />
=== Run as a daemon with systemd user ===<br />
<br />
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:<br />
<br />
{{hc|$HOME/.config/systemd/user/dropbox@.service|<nowiki><br />
[Unit]<br />
Description=Dropbox as a systemd service<br />
After=xorg.target<br />
<br />
[Service]<br />
ExecStart=/home/your_user/.dropbox-dist/dropbox<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
Environment=DISPLAY=%i<br />
<br />
[Install]<br />
WantedBy=mystuff.target<br />
</nowiki>}}<br />
<br />
They you can start or enable it with:<br />
<br />
$ systemctl --user {start|enable} dropbox@:0.service<br />
<br />
That way you can easily start it in your main display (likely :0) or in another one, without having to hard code it.<br />
<br />
{{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.}}<br />
<br />
== Without Nautilus (another way)==<br />
<br />
Another way to use Dropbox without Nautilus but with another file manager like Thunar or Pcmanfm is described below:<br />
<br />
1. Create a fake Nautilus script that will launch Thunar:<br />
$ sudo touch /usr/bin/nautilus && sudo chmod +x /usr/bin/nautilus && sudo nano /usr/bin/nautilus<br />
<br />
2. Insert this text into the file, then save and exit:<br />
#!/bin/bash<br />
exec thunar $2<br />
exit 0<br />
<br />
3. Launch Dropbox:<br />
$ dropboxd<br />
<br />
4. Click on the Dropbox tray icon to open your Dropbox folder in Thunar.<br />
<br />
{{Note|<br />
* 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.<br />
* 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!<br />
}}<br />
<br />
== Securing your Dropbox ==<br />
<br />
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.<br />
<br />
* 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.<br />
<br />
* 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 {{ic|-S}} option of {{Ic|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.<br />
<br />
=== Setup EncFS with Dropbox ===<br />
<br />
Follow the Wiki instructions to install [[EncFS]].<br />
<br />
Assuming you have set your Dropbox directory as {{ic|~/Dropbox}}:<br />
<br />
Create a folder. Files you want synced to Dropbox will go in here.<br />
$ mkdir ~/Private<br />
<br />
Run the following and enter a password when asked:<br />
$ encfs ~/Dropbox/Encrypted ~/Private<br />
<br />
Your secure folder is ready for use; creating any file inside {{ic|~/Private}} will automatically encrypt it into {{ic|~/Dropbox/Encrypted}}, which will then be synced to your cloud storage.<br />
<br />
To mount your EncFS folder on every boot, follow the instructions in the [[EncFS#User_friendly_mounting|EncFS]] wiki page.<br />
<br />
{{Tip|Consider using the {{ic|ENCFS6_CONFIG}} variable and moving the {{ic|.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.}}<br />
<br />
== Multiple Dropbox instances ==<br />
<br />
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.<br />
<br />
The basic principle and general how-to are described in the [http://www.dropboxwiki.com/Multiple_Instances_On_Unix Dropbox Wiki].<br />
<br />
{{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.}}<br />
<br />
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.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
#*******************************<br />
# Multiple dropbox instances<br />
#*******************************<br />
<br />
dropboxes=(.dropbox-personal .dropbox-work)<br />
<br />
for dropbox in ${dropboxes[@]}; do<br />
if ! [ -d $HOME/$dropbox ];then<br />
mkdir $HOME/$dropbox<br />
fi<br />
HOME=$HOME/$dropbox/ /opt/dropbox/dropbox start -i &<br />
done<br />
</nowiki>}}<br />
<br />
== Dropbox on laptops ==<br />
<br />
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.<br />
<br />
=== Using netcfg ===<br />
<br />
The easiest way to solve this with [[netcfg]] is to use POST_UP and PRE_DOWN. In every network profile you use (or in the [[Netcfg#Per-interface_configuration]]), add the appropriate commands:<br />
{{bc|<nowiki><br />
POST_UP="any other code; su -c 'DISPLAY=:0 /usr/bin/dropboxd &' your_user"<br />
PRE_DOWN="any other code; killall dropbox"<br />
</nowiki>}}<br />
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.<br />
<br />
=== Using netctl ===<br />
<br />
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.<br />
{{bc|<nowiki><br />
ExecUpPost="any other code; su -c 'DISPLAY=:0 /usr/bin/dropboxd &' your_user || true"<br />
ExecDownPre="any other code; killall dropbox"<br />
</nowiki>}}<br />
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.<br />
<br />
=== Using NetworkManager ===<br />
<br />
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].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Dropbox keeps saying Downloading files ===<br />
<br />
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. 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:<br />
<br />
UUID=01CD2ABB65E17DE0 /run/media/username/Windows ntfs-3g uid=username,gid=users 0 0<br />
<br />
=== Change the Dropbox location from the installation wizard ===<br />
<br />
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.<br />
<br />
=== Context menu entries in file manager do not work ===<br />
<br />
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 <br />
<br />
$ echo $BROWSER<br />
<br />
To set your {{ic|$BROWSER}} variable open {{ic|~/.profile}} and replace {{ic|chromium}} with your default browser:<br />
<br />
if [ -n "$DISPLAY" ]; then<br />
BROWSER=chromium<br />
fi<br />
<br />
=== Connecting... ===<br />
<br />
{{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}}<br />
{{Poor writing|[[#Dropbox on Laptops|Dropbox on laptops]] is better workarround}}<br />
<br />
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:<br />
<br />
#!/bin/sh<br />
<br />
# Copyright 2008 Evenflow, Inc., 2010 Dropbox<br />
#<br />
# Environment script for the dropbox executable.<br />
<br />
start_dropbox() {<br />
PAR=$(dirname $(readlink -f $0))<br />
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br />
LD_LIBRARY_PATH=$PAR:$LD_LIBRARY_PATH<br />
<br />
TMP1=$(ps ax|grep dropbox|grep -v grep)<br />
if [ -n "$TMP1" ]; then<br />
kill -9 $(pidof dropbox) >/dev/null 2>&1<br />
fi<br />
exec $PAR/dropbox $@ &<br />
}<br />
<br />
do_dropbox() {<br />
start_dropbox >/dev/null 2>&1<br />
while [ 1 ]; do<br />
sleep 5<br />
ERROR="$(net_test)"<br />
if [ -n "$ERROR" ]; then<br />
LAST_ERROR=1<br />
else<br />
if [ -n "$LAST_ERROR" ]; then<br />
# Connection seems to be up but last cycle was down<br />
LAST_ERROR=""<br />
start_dropbox >/dev/null 2>&1<br />
fi<br />
fi<br />
done<br />
}<br />
<br />
net_test() {<br />
TMP1="$(ip addr |grep "inet " |grep -v "127.0.0.1")"<br />
[ -z "$TMP1" ] && echo "error"<br />
}<br />
<br />
do_dropbox<br />
<br />
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.<br />
If none of the specified hosts are available, the script will wait and try again (albeit not forever).<br />
The way the script increments the waiting time is quite messy, but the logic goes like this:<br />
<br />
Start with a wait time of 5 seconds.<br />
<br />
Multiply by 1.5.<br />
<br />
Do this as long as the wait time is less than 1500 seconds (25 minutes), and the check_net()<br />
function returns non-zero values (failure).<br />
<br />
#!/bin/bash<br />
<br />
# Copyright 2008 Evenflow, Inc., 2010 Dropbox<br />
#<br />
# Environment script for the dropbox executable.<br />
<br />
WAIT_TIME=5 #initial time to wait between checking the internet connection<br />
#HOSTS="www.google.com www.wikipedia.org 8.8.8.8 208.67.222.222"<br />
HOSTS="www.google.com www.wikipedia.org "<br />
<br />
PAR=$(dirname $(readlink -f $0))<br />
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br />
LD_LIBRARY_PATH=$PAR${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH<br />
<br />
#non-zero exit code iff none of the hosts could be reached<br />
check_net() {<br />
local ret=1<br />
for i in $HOSTS; do<br />
#ping -w2 -c2 $i > /dev/null 2>&1 && ret=0 && break<br />
curl -o /dev/null $i > /dev/null 2>&1 && ret=0 && break<br />
done<br />
echo $ret<br />
}<br />
<br />
#if dropbox is running; kill it. Then start dropbox<br />
start_dropbox() {<br />
local tmp=$(ps ax|grep -E "[0-9] $PAR/dropbox"|grep -v grep)<br />
if [ -n "$tmp" ]; then<br />
kill -9 $(pidof dropbox) > /dev/null 2>&1<br />
fi<br />
exec $PAR/dropbox $@ > /dev/null 2>&1 &<br />
}<br />
<br />
#loop over: start dropbox iff check_net returns 0<br />
#loop (and with it, the entire script) terminates when dropbox has been restarted,<br />
#+ or the waiting time has exeeded 1500 seconds (it grows 50% with each iteration of the loop)<br />
attempt_startup() {<br />
while [ $WAIT_TIME -lt 1500 ] ; do<br />
if [ $(check_net) -eq 0 ]; then<br />
start_dropbox<br />
exit<br />
fi<br />
sleep $WAIT_TIME<br />
#WAIT_TIME=$(($WAIT_TIME+$WAIT_TIME/2))<br />
let "WAIT_TIME += WAIT_TIME/2"<br />
done<br />
}<br />
<br />
start_dropbox<br />
attempt_startup &<br />
<br />
{{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}}. }}<br />
<br />
=== Dropbox does not start - "This is usually because of a permission error" ===<br />
<br />
==== Check permissions ====<br />
<br />
Make sure that you own Dropbox's directories before running the application. This includes<br />
*{{ic|~/.dropbox}} - Dropbox's configuration directory<br />
*{{ic|~/Dropbox}} - Dropbox's download directory (default)<br />
You can ensure this by changing their owner with {{ic|chown -R}}.<br />
<br />
This error could also be caused by {{ic|/var}} being full.<br />
<br />
==== Re-linking your account ====<br />
<br />
[https://www.dropbox.com/help/72 Dropbox's FAQ] suggests that this error may be caused by misconfiguration and is fixed by (re)moving the current configuration folder<br />
# mv ~/.dropbox ~/.dropbox.old<br />
and restarting Dropbox.<br />
<br />
==== Errors caused by running out of space ====<br />
<br />
A common error that might happen is that there is no more available space on your {{ic|/tmp}} and {{ic|/var}} partitions. If this happens, Dropbox will crash on startup with the following error in its log:<br />
<br />
Exception: Not a valid FileCache file<br />
<br />
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.<br />
<br />
==== Locale caused errors ====<br />
<br />
Try starting {{Ic|dropboxd}} with this code:<br />
<br />
LANG=$LOCALE<br />
dropboxd<br />
<br />
(You can also use a different value for LANG; it must be in the format "en_US.UTF-8")<br />
This helps when running from a Bash script or Bash shell where {{ic|/etc/rc.d/functions}} has been loaded<br />
<br />
==== Filesystem monitoring problem ====<br />
<br />
If you have a lot of files to sync in your Dropbox folder, you might get the following error:<br />
<br />
Unable to monitor filesystem<br />
Please run: echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches and restart Dropbox to correct the problem.<br />
<br />
This can be fixed easily by adding<br />
<br />
fs.inotify.max_user_watches = 100000<br />
<br />
to {{ic|/etc/sysctl.conf}} and then reload the kernel parameters<br />
<br />
# sysctl -p<br />
<br />
=== Proxy settings ===<br />
<br />
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)<br />
env http_proxy=http://your.proxy.here:port /usr/bin/dropboxd<br />
or<br />
export http_proxy=http://your.proxy.here:port<br />
/usr/bin/dropboxd<br />
<br />
Take 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.<br />
<br />
== Alternatives ==<br />
<br />
* [[Ubuntu One]] - {{Pkg|ubuntuone-client}}<br />
* [https://spideroak.com/ Spider Oak] - {{AUR|spideroak}}<br />
* [http://kdropbox.deuteros.es/ KFileBox] - {{AUR|kfilebox}}<br />
* [https://www.wuala.com/ Wuala] - {{AUR|wuala}}</div>Bazmonkeyhttps://wiki.archlinux.org/index.php?title=Dropbox&diff=267439Dropbox2013-07-21T17:04:49Z<p>Bazmonkey: /* Setup EncFS with Dropbox */</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[[de:Dropbox]]<br />
[[it:Dropbox]]<br />
[[ru:Dropbox]]<br />
[[zh-TW:Dropbox]]<br />
[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.<br />
<br />
== Installation ==<br />
<br />
{{AUR|dropbox}} can be installed from the [[Arch User Repository|AUR]]. Alternatively, {{AUR|dropbox-experimental}} is also available.<br />
<br />
# 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.<br />
# 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.<br />
# Eventually a pop-up will ask you to log in to your Dropbox account or create a new account. Enter your credentials.<br />
# 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.<br />
# Press the "Finish and go to My Dropbox".<br />
<br />
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}}.<br />
<br />
=== Optional packages ===<br />
<br />
*For a command-line interface, install {{AUR|dropbox-cli}} from the [[AUR]].<br />
*For integration with Nautilus, install {{AUR|nautilus-dropbox}} from the AUR. The Nautilus plugin will start Dropbox automatically.<br />
*For integration with Nemo, install {{AUR|nemo-dropbox-git}} from the AUR.<br />
*For integration with [[Thunar]], install {{AUR|thunar-dropbox}} from the AUR.<br />
*For [[KDE]] users, there is a KDE client available: {{AUR|kfilebox}} from the AUR.<br />
<br />
=== Automatically starting Dropbox ===<br />
<br />
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]].<br />
<br />
== Alternative to install: use the web interface ==<br />
<br />
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.<br />
<br />
== Run as daemon with systemd ==<br />
<br />
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, then you have to copy the service file to {{ic|/etc/systemd/system/dropbox@.service}} and add the environment variable.<br />
<br />
# echo ".include /usr/lib/systemd/system/dropbox@.service<br />
[Service]<br />
Environment=DISPLAY=:0" > /etc/systemd/system/dropbox@.service<br />
<br />
Finally, to enable the daemon for your user, so that it will start at login:<br />
# systemctl enable dropbox@<user><br />
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.<br />
<br />
=== Run as a daemon with systemd user ===<br />
<br />
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:<br />
<br />
{{hc|$HOME/.config/systemd/user/dropbox@.service|<nowiki><br />
[Unit]<br />
Description=Dropbox as a systemd service<br />
After=xorg.target<br />
<br />
[Service]<br />
ExecStart=/home/your_user/.dropbox-dist/dropbox<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
Environment=DISPLAY=%i<br />
<br />
[Install]<br />
WantedBy=mystuff.target<br />
</nowiki>}}<br />
<br />
They you can start or enable it with:<br />
<br />
$ systemctl --user {start|enable} dropbox@:0.service<br />
<br />
That way you can easily start it in your main display (likely :0) or in another one, without having to hard code it.<br />
<br />
{{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.}}<br />
<br />
== Without Nautilus (another way)==<br />
<br />
Another way to use Dropbox without Nautilus but with another file manager like Thunar or Pcmanfm is described below:<br />
<br />
1. Create a fake Nautilus script that will launch Thunar:<br />
$ sudo touch /usr/bin/nautilus && sudo chmod +x /usr/bin/nautilus && sudo nano /usr/bin/nautilus<br />
<br />
2. Insert this text into the file, then save and exit:<br />
#!/bin/bash<br />
exec thunar $2<br />
exit 0<br />
<br />
3. Launch Dropbox:<br />
$ dropboxd<br />
<br />
4. Click on the Dropbox tray icon to open your Dropbox folder in Thunar.<br />
<br />
{{Note|<br />
* 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.<br />
* 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!<br />
}}<br />
<br />
== Securing your Dropbox ==<br />
<br />
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.<br />
<br />
* 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.<br />
<br />
* 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 {{ic|-S}} option of {{Ic|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.<br />
<br />
=== Setup EncFS with Dropbox ===<br />
<br />
Follow the Wiki instructions to install [[EncFS]].<br />
<br />
Assuming you have set your Dropbox directory as {{ic|~/Dropbox}}:<br />
<br />
Create a folder. Files you want synced to Dropbox will go in here.<br />
$ mkdir ~/Private<br />
<br />
Run the following and enter a password when asked:<br />
$ encfs ~/Dropbox/Encrypted ~/Private<br />
<br />
Your secure folder is ready for use; creating any file inside {{ic|~/Private}} will automatically encrypt it into {{ic|~/Dropbox/Encrypted}}, which will then be synced to your cloud storage.<br />
<br />
To mount your EncFS folder on every boot, follow the instructions in the [[EncFS#User_friendly_mounting|EncFS]] wiki page.<br />
<br />
TIP: Consider using the {{ic|ENCFS6_CONFIG}} variable and moving the {{ic|.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.<br />
<br />
== Multiple Dropbox instances ==<br />
<br />
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.<br />
<br />
The basic principle and general how-to are described in the [http://www.dropboxwiki.com/Multiple_Instances_On_Unix Dropbox Wiki].<br />
<br />
{{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.}}<br />
<br />
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.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
#*******************************<br />
# Multiple dropbox instances<br />
#*******************************<br />
<br />
dropboxes=(.dropbox-personal .dropbox-work)<br />
<br />
for dropbox in ${dropboxes[@]}; do<br />
if ! [ -d $HOME/$dropbox ];then<br />
mkdir $HOME/$dropbox<br />
fi<br />
HOME=$HOME/$dropbox/ /opt/dropbox/dropbox start -i &<br />
done<br />
</nowiki>}}<br />
<br />
== Dropbox on laptops ==<br />
<br />
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.<br />
<br />
=== Using netcfg ===<br />
<br />
The easiest way to solve this with [[netcfg]] is to use POST_UP and PRE_DOWN. In every network profile you use (or in the [[Netcfg#Per-interface_configuration]]), add the appropriate commands:<br />
{{bc|<nowiki><br />
POST_UP="any other code; su -c 'DISPLAY=:0 /usr/bin/dropboxd &' your_user"<br />
PRE_DOWN="any other code; killall dropbox"<br />
</nowiki>}}<br />
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.<br />
<br />
=== Using netctl ===<br />
<br />
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.<br />
{{bc|<nowiki><br />
ExecUpPost="any other code; su -c 'DISPLAY=:0 /usr/bin/dropboxd &' your_user || true"<br />
ExecDownPre="any other code; killall dropbox"<br />
</nowiki>}}<br />
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.<br />
<br />
=== Using NetworkManager ===<br />
<br />
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].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Dropbox keeps saying Downloading files ===<br />
<br />
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. 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:<br />
<br />
UUID=01CD2ABB65E17DE0 /run/media/username/Windows ntfs-3g uid=username,gid=users 0 0<br />
<br />
=== Change the Dropbox location from the installation wizard ===<br />
<br />
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.<br />
<br />
=== Context menu entries in file manager do not work ===<br />
<br />
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 <br />
<br />
$ echo $BROWSER<br />
<br />
To set your {{ic|$BROWSER}} variable open {{ic|~/.profile}} and replace {{ic|chromium}} with your default browser:<br />
<br />
if [ -n "$DISPLAY" ]; then<br />
BROWSER=chromium<br />
fi<br />
<br />
=== Connecting... ===<br />
<br />
{{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}}<br />
{{Poor writing|[[#Dropbox on Laptops|Dropbox on laptops]] is better workarround}}<br />
<br />
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:<br />
<br />
#!/bin/sh<br />
<br />
# Copyright 2008 Evenflow, Inc., 2010 Dropbox<br />
#<br />
# Environment script for the dropbox executable.<br />
<br />
start_dropbox() {<br />
PAR=$(dirname $(readlink -f $0))<br />
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br />
LD_LIBRARY_PATH=$PAR:$LD_LIBRARY_PATH<br />
<br />
TMP1=$(ps ax|grep dropbox|grep -v grep)<br />
if [ -n "$TMP1" ]; then<br />
kill -9 $(pidof dropbox) >/dev/null 2>&1<br />
fi<br />
exec $PAR/dropbox $@ &<br />
}<br />
<br />
do_dropbox() {<br />
start_dropbox >/dev/null 2>&1<br />
while [ 1 ]; do<br />
sleep 5<br />
ERROR="$(net_test)"<br />
if [ -n "$ERROR" ]; then<br />
LAST_ERROR=1<br />
else<br />
if [ -n "$LAST_ERROR" ]; then<br />
# Connection seems to be up but last cycle was down<br />
LAST_ERROR=""<br />
start_dropbox >/dev/null 2>&1<br />
fi<br />
fi<br />
done<br />
}<br />
<br />
net_test() {<br />
TMP1="$(ip addr |grep "inet " |grep -v "127.0.0.1")"<br />
[ -z "$TMP1" ] && echo "error"<br />
}<br />
<br />
do_dropbox<br />
<br />
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.<br />
If none of the specified hosts are available, the script will wait and try again (albeit not forever).<br />
The way the script increments the waiting time is quite messy, but the logic goes like this:<br />
<br />
Start with a wait time of 5 seconds.<br />
<br />
Multiply by 1.5.<br />
<br />
Do this as long as the wait time is less than 1500 seconds (25 minutes), and the check_net()<br />
function returns non-zero values (failure).<br />
<br />
#!/bin/bash<br />
<br />
# Copyright 2008 Evenflow, Inc., 2010 Dropbox<br />
#<br />
# Environment script for the dropbox executable.<br />
<br />
WAIT_TIME=5 #initial time to wait between checking the internet connection<br />
#HOSTS="www.google.com www.wikipedia.org 8.8.8.8 208.67.222.222"<br />
HOSTS="www.google.com www.wikipedia.org "<br />
<br />
PAR=$(dirname $(readlink -f $0))<br />
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br />
LD_LIBRARY_PATH=$PAR${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH<br />
<br />
#non-zero exit code iff none of the hosts could be reached<br />
check_net() {<br />
local ret=1<br />
for i in $HOSTS; do<br />
#ping -w2 -c2 $i > /dev/null 2>&1 && ret=0 && break<br />
curl -o /dev/null $i > /dev/null 2>&1 && ret=0 && break<br />
done<br />
echo $ret<br />
}<br />
<br />
#if dropbox is running; kill it. Then start dropbox<br />
start_dropbox() {<br />
local tmp=$(ps ax|grep -E "[0-9] $PAR/dropbox"|grep -v grep)<br />
if [ -n "$tmp" ]; then<br />
kill -9 $(pidof dropbox) > /dev/null 2>&1<br />
fi<br />
exec $PAR/dropbox $@ > /dev/null 2>&1 &<br />
}<br />
<br />
#loop over: start dropbox iff check_net returns 0<br />
#loop (and with it, the entire script) terminates when dropbox has been restarted,<br />
#+ or the waiting time has exeeded 1500 seconds (it grows 50% with each iteration of the loop)<br />
attempt_startup() {<br />
while [ $WAIT_TIME -lt 1500 ] ; do<br />
if [ $(check_net) -eq 0 ]; then<br />
start_dropbox<br />
exit<br />
fi<br />
sleep $WAIT_TIME<br />
#WAIT_TIME=$(($WAIT_TIME+$WAIT_TIME/2))<br />
let "WAIT_TIME += WAIT_TIME/2"<br />
done<br />
}<br />
<br />
start_dropbox<br />
attempt_startup &<br />
<br />
{{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}}. }}<br />
<br />
=== Dropbox does not start - "This is usually because of a permission error" ===<br />
<br />
==== Check permissions ====<br />
<br />
Make sure that you own Dropbox's directories before running the application. This includes<br />
*{{ic|~/.dropbox}} - Dropbox's configuration directory<br />
*{{ic|~/Dropbox}} - Dropbox's download directory (default)<br />
You can ensure this by changing their owner with {{ic|chown -R}}.<br />
<br />
This error could also be caused by {{ic|/var}} being full.<br />
<br />
==== Re-linking your account ====<br />
<br />
[https://www.dropbox.com/help/72 Dropbox's FAQ] suggests that this error may be caused by misconfiguration and is fixed by (re)moving the current configuration folder<br />
# mv ~/.dropbox ~/.dropbox.old<br />
and restarting Dropbox.<br />
<br />
==== Errors caused by running out of space ====<br />
<br />
A common error that might happen is that there is no more available space on your {{ic|/tmp}} and {{ic|/var}} partitions. If this happens, Dropbox will crash on startup with the following error in its log:<br />
<br />
Exception: Not a valid FileCache file<br />
<br />
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.<br />
<br />
==== Locale caused errors ====<br />
<br />
Try starting {{Ic|dropboxd}} with this code:<br />
<br />
LANG=$LOCALE<br />
dropboxd<br />
<br />
(You can also use a different value for LANG; it must be in the format "en_US.UTF-8")<br />
This helps when running from a Bash script or Bash shell where {{ic|/etc/rc.d/functions}} has been loaded<br />
<br />
==== Filesystem monitoring problem ====<br />
<br />
If you have a lot of files to sync in your Dropbox folder, you might get the following error:<br />
<br />
Unable to monitor filesystem<br />
Please run: echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches and restart Dropbox to correct the problem.<br />
<br />
This can be fixed easily by adding<br />
<br />
fs.inotify.max_user_watches = 100000<br />
<br />
to {{ic|/etc/sysctl.conf}} and then reload the kernel parameters<br />
<br />
# sysctl -p<br />
<br />
=== Proxy settings ===<br />
<br />
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)<br />
env http_proxy=http://your.proxy.here:port /usr/bin/dropboxd<br />
or<br />
export http_proxy=http://your.proxy.here:port<br />
/usr/bin/dropboxd<br />
<br />
Take 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.<br />
<br />
== Alternatives ==<br />
<br />
* [[Ubuntu One]] - {{Pkg|ubuntuone-client}}<br />
* [https://spideroak.com/ Spider Oak] - {{AUR|spideroak}}<br />
* [http://kdropbox.deuteros.es/ KFileBox] - {{AUR|kfilebox}}<br />
* [https://www.wuala.com/ Wuala] - {{AUR|wuala}}</div>Bazmonkey