Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sorry for the weird title...

I'm (still) quite new to linux and are doing shh commands to an Arch Linux device that has not screen output options. So everything has to be done in the terminal (not my super element).

I use the linux device to play around with python (which is quite fun). Now I would like sync my script folder with dropbox. Since I don't have enought space to sync all my dropbox files to the device, I would like to know how I can set it up in a way that it only syncs with the folder I choose.

At the time being I have not installed dropbox because I'm afraid that it will immediately begin to sync all my dropbox folders onto my linux device.

BONUS INFO: I already have created a folder in my dropbox that I that contains some py scripts I would like to have synced with my linux device.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Dropbox now provides a python script to allow you exclude folders. You can download it from here.

To exclude a certain folder just use following command

python ~/dropbox.py exclude 1Password

share|improve this answer
add comment

Install Dropbox

# mkdir -p /tmp/dropbox
# cd /tmp/dropbox
# curl -OL http://dl.getdropbox.com/u/6995/dbmakefakelib.py
# curl -OL http://dl.dropbox.com/u/637552/Dropbox/dbreadconfig.py
# curl -L -o dropbox.tar.gz http://www.dropbox.com/download?plat=lnx.x86_64

Use plat=lnx.x86 if you want the 32-bit client. This creates a temporary directory for our Dropbox install files, and downloads two necessary python scripts: dbmakefakelib.py which creates fake stub copies of GUI libraries so the dropboxd daemon starts, and dbreadconfig.py which displays dropbox configuration information.

Decide which user will be running the Dropbox client; this could be a dedicated user or it could be a regular user. You can also have more than one Dropbox instance running on the system, so you may opt to set it up for multiple users (although each user can only run one Dropbox instance). For this example, we will have created a special user “dropbox” which will run this Dropbox client.

# su - dropbox
$ cd ~/
$ tar xvzf /tmp/dropbox/dropbox.tar.gz
$ cd .dropbox-dist
$ python /tmp/dropbox/dbmakefakelib.py

dropboxd ran for 15 seconds without quitting - success? The dbmakefakelib.py script requires gcc, so you must have gcc installed on the system. This creates fake stub copies of the GUI libraries so that dropboxd will start. At the end, you can see that it launched dropboxd; press [CTRL]C to exit the script. dropboxd should still be running in the background:

$ ps ax | grep dropboxd
24001 pts/0    S      0:00 sh -c { /home/dropbox/.dropbox-dist/dropboxd; } 2>&1

Now that dropbox is running, we need to link it to an existing account:

$ cd ~/
$ python /tmp/dropbox/dbreadconfig.py
host_id = 0bd9c5a15458fbc31f85e892faa7dac4
schema_version = 6

Grab the host_id from above. Login to the Dropbox web interface, and once you have logged in, manually visit this URL:

https://www.dropbox.com/cli_link?host_id=[HOST_ID]

Replace [HOST_ID] with the host_id that dbreadconfig.py outputs. When you have done that, the Dropbox site will tell you that you have successfully linked a new computer. Go to your Account settings and then My Computers and you will see the new computer listed.

If you have not killed the dropboxd process that dbmakefakelib.py started, you will find that it is already downloading the files from the Dropbox to ~/Dropbox/ in the background.

To start the dropboxd daemon in the background at boot, you can add the following to your /etc/rc.d/rc.local init script:

daemon --user dropbox /bin/sh -c "/home/dropbox/.dropbox-dist/dropboxd&"

This will start dropboxd in the background with the privileges of the user for which it is installed (in this case, the user is “dropbox”). If you want to do a system-wide initscript, visit the Dropbox wiki where there are some examples you can use, including initscripts for Fedora/Red Hat and for Debian/Ubuntu. It also has examples for how to set up Dropbox running under DJB’s daemontools.

**Hint to make sure that all the folders are not synced . use a different dropbox account for the linuxbox and share olny the specific scripts folder with it

share|improve this answer
1  
Your hint was a brilliant idea! Why didn't I think of that? –  Norfeldt Nov 24 '12 at 22:52
    
Got this error ::: /usr/bin/ld: cannot open output file /root/.dropbox-dist/fakelib: No s uch file or directory collect2: error: ld returned 1 exit status ::: I haven't created a user since I just wanted to run on the root user –  Norfeldt Nov 24 '12 at 22:53
    
Got the error while running ::: python2 /tmp/dropbox/dbmakefakelib.py ::: had to do python2 since python 3.3 is default on arch, and python2 will do 2.7 –  Norfeldt Nov 24 '12 at 22:54
    
I just realized that it will not work on my linux device since it is an ARM.. –  Norfeldt Nov 25 '12 at 9:24
    
what exactly are your device specifications? maybe we might be able to go for an alternative ;) –  Shenal Silva Nov 25 '12 at 10:58
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.