Jump to content

Installing dropbox on unRAID


hawihoney

Recommended Posts

I saw several topics Dropbox related but they always ended in discussion around their policies.

 

I would like to install a dropbox client on my unRAID servers that will sync selected directories automatically with dropbox. Currently my unRAID boxes are the only machines that do not sync with dropbox - I would like to fix that. Anybody out there with a working installation or at least can help me.

 

Many thanks in advance.

Harald

 

Link to comment

Seems that it is quit easy. There are still some small drawbacks ...

 

Use at your own risk. This post shows how it worked for me. To make it easier just use "mc" (Midnight Commander) to copy the directories mentioned below. Please double check if every file and/or directory is where it should be. If you have a full Dropbox account using wrong directories may end up with Dropbox deleting your files in the cloud. So keep the browser open for a fast "unlink" of a computer if something goes wrong. And if something went wrong - Dropbox keeps your files for 30 days - even after deleting them (that's what I read in the forum). I did not create scripts that run automatically because I have on last problem. Whenever I shutdown the unRAID server the dropboxd process will not be killed by unRAID and the drive with the dropbox folder will not unmount.

 

1.) You need a Dropbox account ;-)

 

If you don't have an account right now please use this link. We will both earn 250MB extra space then.

 

http://db.tt/hbCINFX

 

2.) SSH to your unRAID machine.

 

3.) Change to the root home directory:

cd /root

 

4.) Download the latest Dropbox Linux package from their website (in my case 32bit):

wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86"

 

5.) Untar the package:

tar -xvzf dropbox.tar.gz

 

This will create a folder named "/root/.dropbox-dist". Notice the dot (.) in front of the name.

 

6.) Now comes the hard part. unRAID has no drive with the "programs". "/root/.dropbox-dist" is no good directory. So please copy the complete directory to your flash drive (in my case /boot/custom/packages/.dropbox-dist". Remove the "/root/.dropbox-dist" directory and create a sym link instead:

cp -a /root/.dropbox-dist/ /boot/custom/packages/.dropbox-dist/
rm -r /root/.dropbox-dist
ln -s /boot/custom/packages/.dropbox-dist /root/.dropbox-dist

 

Please double check that the executables "dropbox" and "dropboxd" were copied. In my case "dropbox" had to be copied in a second step again. Don't ask me why - it's Linux. I have no Linux knowledge at all.

 

6.) Now start the dropbox daemon:

/root/.dropbox-dist/dropboxd

 

6a.) This will produce an error and a link will be shown to the console. Copy that link and paste it in a browser of your choice (even on a different machine). This will link your unRAID machine to your Dropbox account. Here's a possible output of the error:

This client is not linked to any account...
Please visit https://www.dropbox.com/cli_link?host_id=1234567890abcdef to link this machine.

 

6b.) CTRL-C or CTRL-Z to stop the daemon.

 

6c.) Now there are two new directories in your /root folder. The first one is the data directory for Dropbox. It's called "Dropbox". Remove it, create a similar named directory on one of your data disks and create a symlink to this new data disk in the root folder. In my case the folder is on "/mnt/disk1".

mkdir /mnt/disk1/Dropbox
rm -r /root/Dropbox
ln -s /mnt/disk1/Dropbox /root/Dropbox

 

6d.) ... The second new created directory is called ".dropbox". Notice the leading dot here too. This directory contains the state of the Dropbox daemon and some SQLite databases with file listings etc.. Copy the entire directory to (in my case) "/mnt/disk1/.dropbox". You could place this directory on the flash drive but the directory is under heavy stress. So I decided to place it on the same data disk as the Dropbox directory from step 6c.). If you place this directory on your flash you need to kill the dropboxd daemon before shutting down your unRAID box. If you don't kill it before shutting down the machine Dropbox will start to delete files. So please put this directory on the same drive as your Dropbox folder (see 6c.)).

cp -a /root/.dropbox/ /mnt/disk1/.dropbox/
rm -r /root/.dropbox
ln -s /mnt/disk1/.dropbox /root/.dropbox

 

7.) I saw several errors because of limited handles. The following code will help:

echo 100000 > /proc/sys/fs/inotify/max_user_watches

 

8.) Now start the daemon:

/root/.dropbox-dist/dropboxd &

 

9.) Why do I use these symlinks? For Linux users of Dropbox there do exist some customer scripts. Some of them work Dropbox-release specific, some need PHP with some special extensions and others need Python with some special extensions. Nothing worked out of the box. To change the settings that are stored in the SQLite database you need deep knowledge of the release level of Dropbox and the settings hierarchie. I couldn't get one single script to work. It was a pain. So I decided to use symlinks.

 

 

At this point everything should be running fine - except the warning in red at the top of this. To make it fully automatic the following startup steps are required during restart of the unRAID box. I've put it at the end of my go script:

# Dropbox
sleep 300
echo 100000 > /proc/sys/fs/inotify/max_user_watches
ln -s /boot/custom/packages/.dropbox-dist /root/.dropbox-dist
ln -s /mnt/disk1/.dropbox /root/.dropbox
ln -s /mnt/disk1/Dropbox /root/Dropbox

 

To manually start the daemon issue this:

cd /root
/root/.dropbox-dist/dropboxd &

 

And now the exit. Whenever unRAID shuts down it should stop the Dropbox daemon first. This is not the case. So the data disk with the Dropbox folder will stay unmounted and unRAID will not shutdown properly. I'll wait for the 5.0 release that will bring exits for unRAID startup and stop. Currently I kill the dropbox process manually before shuttng down:

pkill dropbox

 

Alternatively you can download the official "dropbox.py" CLI to your "/boot/custom/packages/.dropbox-dist/" folder, install a recent python packages and copy the "dropbox.py" within your "go" script to the "/root/" folder and use it there. Starting and stopping is much more comfortable then.

 

Regards

Harald

 

Link to comment
  • 3 weeks later...
  • 4 months later...

Any chance we can get this in unmenu?

Probably, though it is not at the top of my list of things to do right now.  I have other packages I am working on and trying to improve.  If you want the package sooner rather than later my suggestion is to look at all the other wonderful packages that have been created and try to figure out how they work.  It is exactly how I got started in creating them.

Link to comment

Yeah I just saw that. Hence the need to make a dropbox like system on unraid that even your mother can use! Which is what drop box does.

 

I have a few different services to try and get up and running that are similar to dropbox, I just have not had the time to try them out.  I am in the middle of updating the sabnzbd, couchpotato, and sick beard packages... not to mention making changes to the Transmission and Airvideo packages.

 

When I get around to it I will look at all the bookmarks I have for alternates to dropbox and see what I can come up with for use on unRAID.

Link to comment

This would be huge for many users! Come up with a front end secure client with unraid storage as the back end, and auto replication that a non techie can use, you have a winner!

 

I can't wait for somthing like this! As mentioned I want to move away from dropbox as of recent news. I'll keep my fingers crossed for an unraid solution :)

Link to comment

This would be huge for many users! Come up with a front end secure client with unraid storage as the back end, and auto replication that a non techie can use, you have a winner!

 

I can't wait for somthing like this! As mentioned I want to move away from dropbox as of recent news. I'll keep my fingers crossed for an unraid solution :)

Many have set up dropbox on their unRAID servers, but with the storage on their unRAID servers and not in the "cloud"  (Far more secure, apparently)
Link to comment
  • 2 months later...

I found that starting dropbox via the daemon wasn't reliable and that dropbox would crash intermittently.  I found dropbox.py on dropbox.com and that works much better. Here's how I launch it:

 

echo 100000 > /proc/sys/fs/inotify/max_user_watches
ln -s /mnt/cache/.dropboxdb /root/.dropbox
ln -s /mnt/cache/.Dropbox /root/Dropbox
ln -s /boot/custom/packages/.dropbox-dist /root/.dropbox-dist
sleep 60
cd /boot/scripts
python dropbox.py start

 

Python is installed for SABNZBD long before this code is run.  However, I've always got to start dropbox manually after bootup. 

 

cd /boot/scripts
python dropbox.py start

 

does not work.  I'm trying to capture the exact error message.  I'm now trying to see if installing the autostart (dropbox.py autostart y) will work.  Anyone know why this wouldn't work?  Could it be some kind of quotes are need on that line?  I'm kind of lost on this one. 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...