{"id":202,"date":"2012-10-16T10:02:45","date_gmt":"2012-10-16T09:02:45","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=202"},"modified":"2012-10-16T10:04:49","modified_gmt":"2012-10-16T09:04:49","slug":"how-to-install-and-configure-dropbox-on-ubuntu-server-12-04","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=202","title":{"rendered":"How to Install and Configure Dropbox on Ubuntu Server 12.04"},"content":{"rendered":"<p><em>Dropbox<\/em>\u00a0is the best free cloud service and extremely easy-to-use tool for sharing files and syncing them between computers, and you can also use\u00a0Dropbox\u00a0to back up files and access them from other computers and devices (including from your Android Smartphone, android tablets and iPad or iPhone, with dedicated Client apps for each of those devices). How to make dropbox features and services available on ubuntu server?<\/p>\n<p>in this post I would like to show you step by step How to Install Dropbox on\u00a0Ubuntu Server 12.04\u00a0and Sync up to your Dropbox Account. Lets start it.<!--more--><\/p>\n<h2>Installing Dropbox on Ubuntu Server<\/h2>\n<h3>Step 1.\u00a0Download dropbox via Offically dropbox site:<\/h3>\n<p>Dropbox for 32-bit Architecture:<\/p>\n<pre>wget -O dropbox.tar.gz http:\/\/www.dropbox.com\/download\/?plat=lnx.x86<\/pre>\n<p>Dropbox for 64-bit Architecture:<\/p>\n<pre>wget -O dropbox.tar.gz http:\/\/www.dropbox.com\/download\/?plat=lnx.x86_64<\/pre>\n<h3>Step 2.\u00a0Extract Dropbox archieve with command below<\/h3>\n<pre>tar -zxvf\u00a0dropbox.tar.gz<\/pre>\n<h3>Step 3.\u00a0Run the dropbox client deamon on ubuntu server with command below:<\/h3>\n<pre>~\/.dropbox-dist\/dropboxd<\/pre>\n<h2>Sync Ubuntu Server with Your Dropbox Account<\/h2>\n<p>If your ubuntu server is not link to any dropbox account yet, so you will see the following message keep showing every few second:<\/p>\n<pre>xoprst00@copr-ubuntu:~$ .\/.dropbox-dist\/dropboxd\r\nThis client is not linked to any account...\r\nPlease visit https:\/\/www.dropbox.com\/cli_link?host_id=xxxxxxxxxxxxxxxxxx&amp;cl=en_US to link this machine.<\/pre>\n<p>Now copy and \u00a0paste the link to any web browser,you can using any computer. so that it will start to link this machine to your dropbox account. You will be asking to provide your username and password in order to link this to your dropbox account.<\/p>\n<p>If dropbox client on your server is successfully sync with ubuntu server\u00a0you\u2019ll see the message<\/p>\n<pre>Client\u00a0successfully linked, Welcome!<\/pre>\n<p>and it will stop printing the authorization link, it also will automatically create a Dropbox folder under\u00a0<strong><em>~\/Dropbox<\/em><\/strong>\u00a0for the user you\u2019re logged in as.\u00a0Press CTRL + C to terminate the dropbox deamon process<\/p>\n<h2>How to Make Dropbox Start up Automatically on Boot<\/h2>\n<p>Create a new file in directory\u00a0<em>\/etc\/init.d\/<\/em>\u00a0give file name\u00a0<em>dropbox,\u00a0<\/em>it\u00a0for the service management script<\/p>\n<pre>sudo touch \/etc\/init.d\/dropbox<\/pre>\n<pre>sudo nano \/et\/init.d\/dropbox<\/pre>\n<p>Then Grab the following script into file<em>\u00a0\/etc\/init.d\/dropbox.\u00a0<\/em><\/p>\n<pre>#!\/bin\/sh\r\n# dropbox service\r\n# Replace with linux users you want to run Dropbox clients for\r\nDROPBOX_USERS=\"user1 user2\"\r\nDAEMON=.dropbox-dist\/dropbox\r\nstart() {\r\n echo \"Starting dropbox...\"\r\n for dbuser in $DROPBOX_USERS; do\r\n  HOMEDIR=`getent passwd $dbuser | cut -d: -f6`\r\n  if [ -x $HOMEDIR\/$DAEMON ]; then\r\n   start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $HOMEDIR\/$DAEMON\r\n  fi\r\n done\r\n}\r\nstop() {\r\n echo \"Stopping dropbox...\"\r\n for dbuser in $DROPBOX_USERS; do\r\n  HOMEDIR=`getent passwd $dbuser | cut -d: -f6`\r\n  if [ -x $HOMEDIR\/$DAEMON ]; then\r\n   start-stop-daemon -o -c $dbuser -K -u $dbuser -x $HOMEDIR\/$DAEMON\r\n  fi\r\n done\r\n}\r\nstatus() {\r\n for dbuser in $DROPBOX_USERS; do\r\n  dbpid=`pgrep -u $dbuser dropbox`\r\n  if [ -z $dbpid ] ; then\r\n   echo \"dropboxd for USER $dbuser: not running.\"\r\n  else\r\n   echo \"dropboxd for USER $dbuser: running (pid $dbpid)\"\r\n  fi\r\n done\r\n}\r\ncase \"$1\" in\r\n start)\r\n  start\r\n ;;\r\n stop)\r\n  stop\r\n ;;\r\n restart|reload|force-reload)\r\n  stop\r\n  start\r\n ;;\r\n status)\r\n  status\r\n ;;\r\n *)\r\n  echo \"Usage: \/etc\/init.d\/dropbox {start|stop|reload|force-reload|restart|status}\"\r\n  exit 1\r\nesac\r\nexit 0<\/pre>\n<p>If you edited the script in non-UNIX environment, make sure you set the line ending chars correctly. If you are getting such message<\/p>\n<pre>-bash: \/etc\/init.d\/dropbox: \/bin\/sh^M: bad interpreter: No such file or directory<\/pre>\n<p>you can i.e. open the script in vi\u00a0end execute the following steps:<\/p>\n<div>\n<ol>\n<li>sudo vi \/etc\/init.d\/dropbox<\/li>\n<li>:set fileformat=unix (the colon will execute a command and not edit the js file, do not worry)<\/li>\n<li>click enter<\/li>\n<li>now type :wq!<\/li>\n<li>click enter<\/li>\n<\/ol>\n<\/div>\n<p>Make sure the script is executable and add it to default system startup run levels<\/p>\n<div>\n<div>\n<pre>sudo chmod +x \/etc\/init.d\/dropbox<\/pre>\n<pre>sudo update-rc.d dropbox defaults<\/pre>\n<\/div>\n<\/div>\n<p>Control the Dropbox client like any other Ubuntu service<\/p>\n<div>\n<div>\n<pre>sudo service dropbox start|stop|reload|force-reload|restart|status<\/pre>\n<\/div>\n<\/div>\n<h2>How to Check Status Dropbox with Dropbox Python Script<\/h2>\n<p>Download the dropbox.py script and \u00a0make the file excuteable<\/p>\n<pre>wget -O ~\/.dropbox\/dropbox.py http:\/\/www.dropbox.com\/download?dl=packages\/dropbox.py<\/pre>\n<pre>chmod +x ~\/.dropbox\/dropbox.py<\/pre>\n<p>Now you can easily check the status of the Dropbox client with following command<\/p>\n<pre>~\/.dropbox\/dropbox.py status<\/pre>\n<p>Get more help dropbox.py with following command<\/p>\n<div>\n<pre>~\/.dropbox\/dropbox.py help<\/pre>\n<p>You can also use the\u00a0<em>exclude<\/em>\u00a0command to keep specific files or folders from syncing to ubuntu server<\/p>\n<\/div>\n<div>\n<pre>~\/.dropbox\/dropbox.py help exclude<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Dropbox\u00a0is the best free cloud service and extremely easy-to-use tool for sharing files and syncing them between computers, and you can also use\u00a0Dropbox\u00a0to back up files and access them from other computers and devices (including from your Android Smartphone, android &hellip; <a href=\"https:\/\/oprsteny.cz\/?p=202\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[39,45,38,5],"tags":[48,49],"class_list":["post-202","post","type-post","status-publish","format-standard","hentry","category-infrastructure","category-linux","category-software","category-tools","tag-dropbox","tag-ubuntu"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-3g","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202"}],"version-history":[{"count":2,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/202\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/202\/revisions\/204"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}