0

I've been using Dropbox and symlinks to keep two Ubuntu computers in sync, for years.

The setup is a bit fiddly, because some links go TO the Dropbox folder, and some come FROM it, depending on how things are set up, but I haven't had any problems.

Now, I want to simplify things, but I'm a bit concerned about existing directories. Specifically, Desktop, Downloads, and Pictures.

My thinking is that it should be ok to do, on both computers, this:

me@computer:~$ ln -sfn /home/me/Dropbox/Desktop /home/me/Desktop

But maybe Gnome treats Desktop as some sort of special directory. I tried it with the Downloads directory, and the system won't allow me overwrite it, even with sudo.

Any ideas?

6
  • See askubuntu.com/questions/600714/… Sep 14, 2018 at 23:04
  • I'd have to delete /home/user/Desktop for the first option to work and then create it with the ln command. I don't know what would happen if I tried that. Mount bind, which I hadn't heard of, sounds much better. Thank you. Sep 14, 2018 at 23:10
  • I want to test that bind on a vm to see how it plays with Desktop and will let you know Sep 14, 2018 at 23:15
  • I mounted the Downloads directory and it works very well. I've only noticed two details: 1) the Nautilus windows says 250 GB Volume, instead of Home - Me - Downloads. If I CTRL-L to see the path, it reports it correctly: /home/me/Downloads. 2) When I delete a file, it says "<filename> can't be put in the trash. Do you want to delete it immediately?" Other than that, I haven't found any problems. Next up, set it up to survive a reboot! Sep 14, 2018 at 23:24
  • Ah, it also mounted the entire hard drive to the Desktop! 0_o Sep 15, 2018 at 0:01

1 Answer 1

0

I would use the mount command's bind option to sync the two computers as this would prevent the removal of the Desktop folder so the link command would not re-create the Dropbox folder in that location. The terminal command to use to achieve this is:

sudo mount --bind ~/Dropbox  ~/Desktop

or

sudo mount -o bind ~/Dropbox  ~/Desktop

To make this permanent add the following line to the /etc/fstab file:

/home/$USER/Dropbox         /home/$USER/Desktop    none     rw,bind,nowaitboot     0     0

This nowaitboot ensures that if the dropbox folder isn't there your system will still boot.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .