Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

To keep multiple computers synced with dropbox I tried the following.

Approach A.

-Computer 1: Install dropbox, dropbox folder: /Dropbox/
-Computer 1: Create symbolic link in that folder to home folder

   $ln -s /home/ /Dropbox/

-Computer 2: Install dropbox, dropbox folder: /Dropbox/ (got populated with files from computer 1
-Computer 2: Try to overwrite the files with symbolic links to identical local files

$ln -sfn /home/ /Dropbox/
  ln: `/Dropbox/home': cannot overwrite directory

So that approach fails, does anyone have a suggestion to fix the error? Or another approach? The approaches I have come up so far:

Approach B. I could write a script to recursively symlink all the files but I would rather not go that direction since then I would have to run that script in order to pickup on new files.

Approach C. Use rsync to sync between the home and dropbox folder. I would not like that since then it is not automatically updated, you would have to call rsync to do that. And putting rsync in a cronjob that runs each minute seems not like a ideal solution.

Can someone help me with fixing approach A or coming up with approach D or convincing me of approach B or C ?

share|improve this question

2 Answers 2

Is there really no possible way to specify which directory you want Dropbox to operate on? You can't just tell Dropbox to use /home?

If not, you could try skipping symlinks entirely and use several bind mounts to accomplish this. In other words:

mount --bind /home /Dropbox

on both computers.

share|improve this answer
    
I tried it on computer 2, in /Dropbox/ it showed the exact contents of the home folder of computer 2. But dropbox did not sync it to computer 1. And when I unmounted it the original contents of the /Dropbox folder showed again, the files of computer 1. –  Sebastian Dec 14 '12 at 9:10
up vote 0 down vote accepted

I thought of a workaround for the problems with approach A:

-Computer 2: Pause syncing of dropbox by right-clicking on the notification icon and select 'pause syncing'
-Computer 2: Remove all files in your dropbox (optional move them to your home folder overwriting the local files, however in this scenario they are identical)
-Computer 2: Symlink like you did on computer 1, a link in the dropbox folder to the home folder:

$ln -s /home/ /Dropbox/ 

-Computer 2: Resume syncing of the dropbox daemon, since the symlinks point to the exact same files no syncing should happen.

I think this is a good solution because the home folder stays intact and dropbox does what it needs to do in another folder in the background. Not really straightforward though.

I also thought of approach A2 and will share it here as an alternative:
-Computer 2: remove the original files in your home folder and create a symlink in your home folder to the Dropbox files

Cons: this causes all the icons in your home folder to have the link arrow on them
Now you have symlinks in your home folder instead of files, you have to be aware of this when you do file operations on them

share|improve this answer

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.