This post will help you install the Linux Dropbox client on your headless Ubuntu Server and link it up to your Dropbox account. Unlike the process of mounting an S3 bucket we looked at before the Dropbox approach is a much better solution for sharing files. If you’re a daily Dropbox user you’ll quickly get hooked on the convenience of having your servers in the same file sharing loop as all your other Dropbox connected devices!
Installing Dropbox
Start off by downloading the Linux version of Dropbox onto your server. These steps have been tested on Ubuntu Server 10.10 and 11.04.
Download the 32Bit Version
Download the 64Bit Version
If you unsure which version you need you can quickly check by running uname -a.
If the uname output has an i686 at the end you need the 32Bit version and if it hasx86_64 you want the 64Bit version.
When you extract the Dropbox archive it will automatically place its files in the home directory of the the user you’re logged in as under: ~/.dropbox. You can always move these files later but its something to keep in mind.
Extract the Dropbox archive
Linking Your Server to Your Dropbox Account
Before you take the next step you’ll want to make sure your LANG environment variable is set to a value other than NULL.
Check the value of your LANG environment variable
To connect the Dropbox client on your server to your Dropbox account you’ll need to copy the link it outputs into a browser window and then login to your Dropbox account.
Run dropboxd on your server
It will start outputting a link similar to this one every few seconds
The trick to a smooth link is to make sure you leave dropboxd running while you follow the link. You don’t need to access the link from the server you’re trying to install Dropbox on. You can copy and paste that link into a browser running on a separate machine and Dropbox will authorize the client running on your server.
Once it succeeds you’ll see the message Client successfully linked, Welcome! on your server and it will stop printing the authorization link.
Hit ctrl c to terminate the process
Once the Dropbox client on your server is successfully linked it will automatically create a Dropbox folder under ~/Dropbox for the user you’re logged in as. All your folders will be visible under the Dropbox folder but since the Dropbox service isn’t actually running on your server yet you you won’t be able to see the files inside these folders until the client is running and has a check to synchronize.
You can manually start the service by running
However, a better option for controlling the Dropbox client is to setup an Ubuntu service management script for it.
Start Dropbox Automatically On Boot
Dropbox provides a handy little service management script that makes it easy to start, stop and check the status of the Dropbox client.
Create a new file for the service management script
Paste the following script into the new file
Make sure you replace the value of DROPBOX_USERS with a comma separated list of the linux users on your machine you want to run the Dropbox client to run for. Each user in the list should have a copy of the Dropbox files and folders that you extracted from the archive, available under their home directory.
Make sure the script is executable and add it to default system startup run levels
Control the Dropbox client like any other Ubuntu service
Depending upon the number of files you have on Dropbox and the speed of your internet connection it may take some time for the Dropbox client to synchronize everything.
Check Status with Dropbox CLI
Dropbox has a command line python script available separately to provide more functionality and details on the status of the Dropbox client.
Download the dropbox.py script and adjust the file permissions
You can download the script anywhere you like, I’ve included it along with the rest of the Dropbox files.
Now you can easily check the status of the Dropbox client
Get a full list of CLI commands
Use the exclude command to keep specific files or folders from syncing to your server
Once the Dropbox service is running and fully syncrhonized you can access all your Dropbox files and easily share files on your server with all your other Dropbox connected gadgets!
For more resources and troubleshooting tips visit the Dropbox forums. Happy syncing!
No comments:
Post a Comment
Jangan Lupa Berilah Komentar!!
Trimakasih atas kunjungannnya.