Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1039  / 2 Years ago, fri, september 2, 2022, 2:06:08

I'm looking for a way to keep a desktop and a laptop in sync. What I want to keep in sync are some folders, mainly ~/Documents, that are changed often when working on them.



If it matters I can connect to my desktop from anywhere via an URL but my laptop is harder to access since it might be behind NAT and such.



I have been looking at Ubuntu One but it seems to not go well with working on documents written in LaTeX. If I work on a .tex file in the Ubuntu One directory and compile it (with pdflatex) every now and then (as often as every 10 sec when working) it will create several new files including a pdf which are uploaded to Ubuntu One and this seems stupid since it will create continuous upload when working on .tex files. I also usually keep .tex documents version controlled by git and then every commit (which also can happen frequently) will cause upload (by changes in ./.git) so that it happens continuously when working. Another example is editing images that are saved often. What I think would be best is for sync to happen every tenth minute or at the end of every working session (but there might be some other way to handle this?).


More From » ubuntu-one

 Answers
5

This is a solution based on fossfreedom's answer to another question, Synchronizing 2 Ubuntu Systems with Unison, the Unison manual and my answer to another question.



Setup



Both computers




  1. sudo apt-get install openssh-server unison

  2. Test the SSH link from each computer to the other.



On the computer that might be behind NAT




  1. mkdir ~/.unison

  2. nano default.prf – Create a profile file named default.

  3. Write the profile file, e.g.:



    root = /home/user

    root = ssh://[email protected]//home/user

    path = Documents



Sync



Sync the computers by running unison -auto default on the computer that might be behind NAT. This will sync ~/Documents. I do this before and after my laptop leaves the LAN with my desktop to keep their documents in sync.


[#44407] Saturday, September 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ntlesslving

Total Points: 123
Total Questions: 109
Total Answers: 113

Location: South Korea
Member since Fri, Sep 11, 2020
4 Years ago
;