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?

Eugenio Perea
  • 1,113
  • 8
  • 18
  • See https://askubuntu.com/questions/600714/creating-a-symlink-from-one-folder-to-another-with-different- – George Udosen Sep 14 '18 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. – Eugenio Perea Sep 14 '18 at 23:10
  • I want to test that bind on a vm to see how it plays with Desktop and will let you know – George Udosen Sep 14 '18 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 " 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! – Eugenio Perea Sep 14 '18 at 23:24
  • Ah, it also mounted the entire hard drive to the Desktop! 0_o – Eugenio Perea Sep 15 '18 at 00:01
  • Can I see the out of this command `df -h` and note it should be `~/Dropbox ~/Desktop none rw,bind 0 0` – George Udosen Sep 15 '18 at 00:37

1 Answers1

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.

George Udosen
  • 35,970
  • 13
  • 99
  • 121