8 февр. 2012 г.

Dropbox console for CentOS

How to install dropbox on your linux server (console mode)

1. Download http://www.getdropbox.com/download?plat=lnx.x86 or http://www.getdropbox.com/download?plat=lnx.x86_64

2. Extract tar.gz file downloaded and leave in root home folder

3. Run
~/.dropbox-dist/dropboxd to get Dropbox to provide a URL to go to in your browser to link this computer to your Dropbox account

4. After visiting the URL in a browser to which you've logged into dropbox.com, you'll see message smth like: Successfully linked etc.

5. If you cannot quit the app by ctrl+c , open another a shell, get the PID by running
$ ps -ef|grep dropbox and kill PID. The output on your other shell should say: Terminated

6. Now you can run Dropbox in the background, enter:
$ /root/.dropbox-dist/dropboxd &
7. When that's working, we'll want to install Dropbox as a server. To do so:
$ vi /etc/init.d/dropbox
and paste the following into that file:
# 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

lockfile=${LOCKFILE-/var/lock/subsys/dropbox}

RETVAL=0

start() {
        echo -n $"Starting $prog"
            daemon --user root /bin/sh -c "/root/.dropbox-dist/dropboxd &"
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
         return $RETVAL
}

stop() {
        echo -n $"Stopping $prog"
        killproc /root/.dropbox-dist/dropbox
        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

8. And finally:
$ chmod +x /etc/init.d/dropbox
$ chkconfig --add dropbox
$ chmod 755 /etc/init.d/dropbox

1 комментарий:

yucha комментирует...

Ваша статья была очень полезна.
Спасибо.
Из Японии.