Home > bash, python > dropbox: command-line interface

dropbox: command-line interface

I wanted to test the status of my Dropbox client from the terminal. Actually, I wanted to write a script that executes an action when my Dropbox folder is fully synced. So I wanted to test the status if it’s “working” or “synced”.

I found the solution here. It turned out that Dropbox has an official command-line script that can do this and much more. First, get it:

wget -O ~/dropbox.py https://www.dropbox.com/download?dl=packages/dropbox.py
chmod u+x ~/dropbox.py
~/dropbox.py status

This is a Python script, written in Python 2, thus I modified the first line to be “#!/usr/bin/env python2“.

This script can do several things for you:

$ dropbox.py 
Dropbox command-line interface


Note: use dropbox help  to view usage for a specific command.

 status       get current status of the dropboxd
 help         provide help
 puburl       get public url of a file in your dropbox
 stop         stop dropboxd
 running      return whether dropbox is running
 start        start dropboxd
 filestatus   get current sync status of one or more files
 ls           list directory contents with current sync status
 autostart    automatically start dropbox at login
 exclude      ignores/excludes a directory from syncing
 lansync      enables or disables LAN sync

Some years ago I wrote a simple script to get the public URL of a file in my Dropbox folder. This script can do that too with the “puburl” command.

Categories: bash, python Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: