Using dropbox / symbolic link combo successfully

4

1

In the past I have kept some files on dropbox by copying them into my ~/Dropbox folder on Ubuntu. I don't want to move the original files into Dropbox synch folder or muck around with my directory structure. Then I have found I was using dropbox more and more, and wasting a lot of space this way by duplication of data. I use a small SSD locally for OS, any other data is kept on mounted shares from my NAS. I found I could successfully get files up to the cloud by using symbolic links like:

ln -s /some/mounted/share/dir ~/Dropbox/dir

And dropbox would carry on and sync those files remotely whilst only using up the space of the symbolic link locally.

This worked well for me for a few weeks, until I turned on my laptop one day and saw '421 files have been removed from your dropbox' notification. They were still there in the original mounted share, but the symbolic links I'd made were completely gone for some reason. What did I do wrong? It is possible the share could have become unmounted, but I didn't expect this would cause all my files to be deleted from the cloud could it? How can I 'share' files on my dropbox in this way without the danger of the originals being modified from remotely?

wim

Posted 2012-11-27T04:37:31.503

Reputation: 2 523

Answers

2

You can use the --bind option of mount to make one directory appear in another (much like a symbolic link, the mount point has to exist, though). See man mount for details.
If you want to preserve the link after a reboot (which I guess you do), add something like this to /etc/fstab:

 /path-to-the-network-share /some-empty-directory none bind 0 0

After a reboot, the contents of /path-to-the-network-share should appear in /some-empty-directory without taking up any extra space - it's just a link after all.

One thing that might come to haunt you, is that your files are on a network share. If the share ever becomes unavailable (which it might be during booting), mounting or accessing the link directory will fail and Dropbox might start deleting files again. If that happens, go to the Dropbox website, they've got a really handy un-delete feature which can restore files to every version from the past 30 days.

n.st

Posted 2012-11-27T04:37:31.503

Reputation: 1 538