Mirror 2 linux machines

2

I have a notebook with Fedora 25 and a online server with Fedora 25 too.

I want to mirror my notebook with my server in a such way that, if I connect direct on the server with NoMachine, it will be able to work as if I'm on my notebook. Is it possible? I thought of using Unison for that, but I don't know if Unison works to syncing in a "online way", that is, sync files every time something changes on the notebook (or every X minutes).

I'm asking that because I want a virtual desktop to be accessible from anywhere, so, I installed NoMachine on my cloud server, but, even with H.264 codecs, it has some lags, so I think if is it possible to have 2 machines synced in such a way that the 2 machines are exactly the same. Does anyone know if is it possible?

Renato Ferreira

Posted 2017-09-10T15:25:11.807

Reputation: 21

Answers

0

Unison does 2-way synchronization and would allow you to have two (or more!) synchronized directories, with Unison figuring out in which way modifications should travel to keep all copies at the latest version.

That said, however, Unison does not work in 'daemon mode' (that is, it does not sync 'in the background'); you have to initiate a synchronization manually by running the Unison executable. While you could schedule this with a cron job, I would not recommend this, as you will probably want to resolve conflicts manually.

There are other services that are designed to be synchronizing in the background, which seems to be more in line with what you expect. There is a certain well-known commercial service that you could use for that (and probably many others), or you could try ownCloud or Nextcloud.

Edward

Posted 2017-09-10T15:25:11.807

Reputation: 774

Update: I may be wrong about Unison not being able to run in daemon mode. There is this answer that suggests this may work, although I haven't tried it myself.

– Edward – 2018-10-01T08:20:13.013

0

I use Nextcloud to achieve what you are doing. It may not be a typical tool for that kind of task but it works just fine. My server runs a Nextcloud instance (or you can use docker), and my workstation and my laptop are clients. Everything is birectionally synced everywhere

Matt

Posted 2017-09-10T15:25:11.807

Reputation: 23

I have to add: I do this for all my personal data, not for system files since the setup (incl. drivers and so on) are different on the two machines that I work on. – Matt – 2017-09-18T19:01:53.320