Dropbox Command Line Ubuntu Install
So there is a little bit to this, here are some notes that should be pretty easy to follow.
Get the platform type
$ uname -a
Install Dropbox
Log in to your Linux server so you obtain a shell prompt, and change to your home directory.
$ cd
Install EITHER the 32 OR 64 bit version.
Stable 32-bit:
$ wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86"
Stable 64-bit:
$ wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86_64"
Extract the zip file.
$ tar -xvzf dropbox.tar.gz
Make sure the LANG environment variable is set to something other than NULL, e.g. en_US.iso88591. If it is NULL, you'll get a cryptic error.
$ echo $LANG
Run dropboxd:
$ ~/.dropbox-dist/dropboxd
You should see output like this:
This client is not linked to any account... Please visit https://www.dropbox.... to link this machine.
dropboxd will create a ~/Dropbox folder and start synchronizing it after this step! Go to the URL given; you should see a success message at the top of your screen.
Autostart dropbox
Then follow instructions below making sure to edit the script and set the DROPBOX_USERS section to your user.
# Create a service to run at boot
$ sudo nano /etc/init.d/dropbox
# Paste the following in - set user name first
# dropbox service
DROPBOX_USERS="ubuntu"
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
# Next, make the script executable.
$ sudo chmod +x /etc/init.d/dropbox
# Finally, set up the script to run at boot.
$ sudo update-rc.d dropbox defaults
# To start the service:
$ sudo service dropbox start
# Now normal control commands can be use like...
$ sudo service dropbox start|stop|reload|force-reload|restart|status
[OPTIONAL] Install the dropbox command line client
$ mkdir -p ~/bin
$ wget -O ~/bin/dropbox.py "http://www.dropbox.com/download?dl=packages/dropbox.py"
$ chmod 755 ~/bin/dropbox.py
$ ~/bin/dropbox.py help
$ ~/bin/dropbox.py status
# You can manually start the service like this:
$ ~/.dropbox-dist/dropbox
Comments