Home > technology > Install Dropbox remotely on Ubuntu

Install Dropbox remotely on Ubuntu

DropboxEverybody know how useful Dropbox is (up to 10Gb free web-disk with amazing sync capabilities), I wanted to install it on a Ubuntu Server remotely (over a ssh connection) to automatically copy my backups to a external server.

I was having some trouble but after some digging I found the way (sources: here and here).

Here is a quick to do list and the commands you have to run to do it.

Install Dropbox

Delete any version of Dropbox on your computer, download and untar the Dropbox daemon to your home folder:

cd ~
rm -rf .dropbox* Dropbox
wget http://dl-web.dropbox.com/u/17/dropbox-lnx.x86-0.7.110.tar.gz
tar xzf dropbox-lnx.x86-0.7.110.tar.gz

Start the “.dropbox-dist/dropbox” executable from the terminal:

.dropbox-dist/dropbox

Copy and paste the link the Dropbox daemon gives you, into the web browser on your local computer.
Once the DB client is linked to the correct account, shut it down and start it in the background:

nohup .dropbox-dist/dropboxd &

Now the Dropbox is install and running but once you reboot Dropbox won’t automatically startup.

Add Dropbox to system startup

Create a startup script:

sudo nano /etc/init.d/dropbox

Copy the text below to the new file you have created:

# chkconfig: 345 85 15
# description: Startup script for dropbox daemon
#
# processname: dropboxd
# pidfile: /var/run/dropbox.pid
#
# Source function library.
. /etc/rc.d/init.d/functions

DROPBOX_USERS=”user1 user2″

prog=dropboxd
lockfile=${LOCKFILE-/var/lock/subsys/dropbox}
RETVAL=0

start() {
echo -n $”Starting $prog”
for dbuser in $DROPBOX_USERS; do
daemon –user $dbuser /home/$dbuser/.dropbox-dist/dropboxd
done

RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}

stop() {
echo -n $”Stopping $prog”
for dbuser in $DROPBOX_USERS; do
killproc /home/$dbuser/.dropbox-dist/dropboxd
done
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}

# See how we were called.
case “$1″ in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $”Usage: $prog {start|stop|restart}”
RETVAL=3
esac

exit $RETVAL

Change above the DROPBOX_USERS to include all users that want to run dropboxd (separated by spaces), and save the file.
Make the script executable:

sudo chmod +x /etc/init.d/dropbox

Add the script to the startup scripts:

sudo update-rc.d dropbox defaults

And it’s done! :) But if after this you want to manually start, stop or restart…

Manually start Dropbox

To start the service manually, run:

/etc/init.d/dropbox start

To stop it, run:

/etc/init.d/dropbox stop

To restart it, run:

/etc/init.d/dropbox restart

You can also check running status with:

/etc/init.d/dropbox status

Any doubt or suggestion feel free to ask!

Share this:
  • email
  • Twitter
  • Facebook
  • LinkedIn
  • RSS
  • StumbleUpon
  • Digg
  • del.icio.us
  • Netvibes
  • Google Bookmarks
  • PDF
  1. No comments yet.
  1. No trackbacks yet.