18

After another user asked this question: Dropbox on linux server - how to include/exclude folders?

My icon is still not working after performing some of the steps listed in other questions and answers:

Edit: In case anyone was wondering while reading this post, I was able to get my icon to show up finally by following these links:

The question should still be valid for anyone that wants to do this from the command line.

There was an answer for excluding, but not one for including. Is there any way to achieve this?

I see the former command listed in the dropbox command's help text, but not anything that could help me with including.

Does anybody know how to achieve this?

Here is the current help text that I see:

Dropbox command-line interface  

commands:  

Note: use dropbox help <command> 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  

I also found some official Dropbox help documentation that also strangely only mentions excluding files, without including others from the Dropbox folder that are not currently synced.

Pysis
  • 283
  • 1
  • 2
  • 8

2 Answers2

27

To exclude all files/folders:

  • cd to your dropbox folder (usually cd ~/Dropbox)
  • then type ~/bin/dropbox.py exclude add * This will exclude everything in your dropbox folder from syncing. (Be careful! This will remove all the files that you synced)
  • Then, if you want to start syncing the folder "dir", type ~/bin/dropbox.py exclude remove dir

Taken from http://www.dropboxwiki.com/tips-and-tricks/using-the-official-dropbox-command-line-interface-cli#comment-1778553228

undersound
  • 430
  • 5
  • 9
0

If you need to simply sync one deep directory you may need to repeat the previously accepted Answer procedure recursively. For example, if you are trying to sync a Minecraft server to a hosted VM, where the files you need are located in /Dropbox/Media/Software/Games/Minecraft you can do:

cd ~/Dropbox
~/bin/dropbox.py exclude add *
~/bin/dropbox.py exclude remove Media
<wait for partial sync>
cd Media
~/bin/dropbox.py exclude add *
~/bin/dropbox.py exclude remove Software
<wait for partial sync>
cd Software
~/bin/dropbox.py exclude add *
~/bin/dropbox.py exclude remove Games
<wait for partial sync>
cd Games
~/bin/dropbox.py exclude add *
~/bin/dropbox.py exclude remove Minecraft

Basically you have to go through several rounds of exclude/include, one for each subdirectory deeper you go.

r3cgm
  • 167
  • 1
  • 1
  • 6