Skip to main content
2 of 6
improved answer
tukan
  • 2.3k
  • 13
  • 20

If you are on linux it is quite easy. During the sync process you can do:

find $HOME/dropbox_sync_dir -type f -exec dropbox.py file status -a '{}' \; | grep 'syncing'

Explaining details:

  • find <path> -type f -exec dropbox.py ... '{}' \;

Runs dropbox.py on every file or below the current directory.

Notice that the braces are enclosed in single quote marks to protect them from interpretation as shell script punctuation. The semicolon is similarly protected by the use of a backslash, though single quotes could have been used in that case also.

More on man find pages

  • dropbox.py file status -a from the dropbox linux client manual:

     dropbox file status  [-l] [-a] [FILE]…
    
     Prints the current status of each FILE.
    
       Options:
    
        -l or --list prints out information in a format similar to the native Linux command ls.
        -a or --all do not ignore entries starting with "."
    
    Aliases include stat.
    
  • | grep 'syncing'

Searches for the 'syncing' string.

Note: that the .py end should not be mandatory there should be an alias so writing just dropbox should be enough.

First Edit

Finally after the Paul's comments I understood where is the core of the issue. He wants to see the currently accessed file or even better the one being transferred by the dropbox sync client.

  • You could find all files used by the dropbox client currently used:

     ls -thal /proc/`pgrep dropbox`/fd | egrep -v 'socket:|pipe:|anon_inode|/dev/'
    
  • If you can not see anything that means that something is probably wrong with the client. I would recommend performing strace.

     To monitor your dropbox.py script with output save into output.txt file:
     `strace -o output.txt dropbox.py`
    
     To monitor only system calls you could enter:
     `strace -e open dropbox.py`
    
  • If you want to go even deeper you could attach an debugger e.g. gdb to your strace session.

If you are unfamiliar with this process you can check,for example, this nice post about unix strace and gdb.

Just a quick help:

When you start your trace with: strace dropbox.py (running pid would be 501) Then you attach to it the following way:

$ gdb --quiet
(gdb) attach 501
  • If everything else fails you can use other ways to sync your dropbox:

For example, use a different cli client like dbxcli.

tukan
  • 2.3k
  • 13
  • 20