How to install Dropbox on VPS/Server/Text Only Linux

Beside can be installed on ‘normal’ linux (Linux with GUI), dropbox also can be installed on VPS/server/text only linux environment. It is very usefull to be a backup of my server. These steps only tested on 64 bit debian 5 and debian 6 , but it should work on ubuntu.
Register
https://www.dropbox.com/register

Get Installer
64 bit:
cd
wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86_64"
32 bit:
cd
wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86"
Extract and Run dropboxd
tar -xvzf dropbox.tar.gz
 
~/.dropbox-dist/dropboxd
You should see output like this
This client is not linked to any account...
Please visit https://www.dropbox.com/cli_link?host_id=7d44a557aa58f285f2da02c1 to link this machine.
Click on the link !
Get Dropbox startup script
### BEGIN INIT INFO
# Provides:          dropbox
# Required-Start:    $local_fs $remote_fs $network $syslog $named
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     false
# Short-Description: dropbox service
### END INIT INFO
# dropbox service
DROPBOX_USERS="codernotes"
 
DAEMON=.dropbox-dist/dropbox
 
start() {
    echo "Starting dropbox..."
    for dbuser in $DROPBOX_USERS; do
        HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
        if [ -x $HOMEDIR/$DAEMON ]; then
            HOME="$HOMEDIR" start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $HOMEDIR/$DAEMON
        fi
    done
}
 
stop() {
    echo "Stopping dropbox..."
    for dbuser in $DROPBOX_USERS; do
        HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
        if [ -x $HOMEDIR/$DAEMON ]; then
            start-stop-daemon -o -c $dbuser -K -u $dbuser -x $HOMEDIR/$DAEMON
        fi
    done
}
 
status() {
    for dbuser in $DROPBOX_USERS; do
        dbpid=`pgrep -u $dbuser dropbox`
        if [ -z $dbpid ] ; then
            echo "dropboxd for USER $dbuser: not running."
        else
            echo "dropboxd for USER $dbuser: running (pid $dbpid)"
        fi
    done
}
 
case "$1" in
 
    start)
        start
        ;;
 
    stop)
        stop
        ;;
 
    restart|reload|force-reload)
        stop
        start
        ;;
 
    status)
        status
        ;;
 
    *)
        echo "Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}"
        exit 1
 
esac
 
exit 0
Change DROPBOX_USERS to you username
Put the file on /etc/init.d/dropbox.
Make it executable and add it to system startup
chmod +x /etc/init.d/dropbox
update-rc.d dropbox defaults

0 comments:

Post a Comment