0

I am asking this because Unison is notoriously problematic when one tries to sync among different OS that have different versions and have been compiled with different Ocaml version.

So what would be a good alternative? I just want to sync two folders one way at a time. Is there something similar with Unison that it's not too difficult to operate?

The one machine runs Ubuntu 18.04 and the other Ubuntu 20.04.

2
  • 2
    Have you considered rsync? This script is what I use to sync one zvol to a backup zvol on FreeNAS.
    – JW0914
    Apr 28, 2020 at 12:23
  • 1
    @JW0914 hit it on the head.. linux already has a built in utility to do this. As a bonus.. rsync is 24 years old. The code is very well vetted. Apr 28, 2020 at 15:25

1 Answer 1

1

rsync it is a excellent choice but you need some other things between the two machines al ready set for start a ssh server running in at least one of the machine's if you don't want to use passwords every time you do sync folders you must set a ssh-id key it is more secure, if the two machines are in the same network there are not a problem but if they are in different places then you need to do a port-forwarding, lets keep it simple in a local network, ssh server in each linux machine you must do

"I forgot this is an script shell and there it not a GUI for it almost i don't know it, this you have to do it from terminal but it is very easy to ,it is powerful and fast"

from the machine where it is the source folder

rsync -avz "/path/to/folder/to/sync" userontheremotemachine@ip.remote.machine:/folder/where/it/is/going/to/be

at first try to avoid spaces on the remote path or use \ like

/folder where/it is/going to be

it will be

"/folder\ where/it\ is/going\ to\ be"

another way to deal with spaces on the paths it is adding -s like

rsync -avzs "/path to/folder to/sync" etc......

or

rsync -avzs userontheremotemachine@ip.remote.machine:"/path to/folder to/sync" etc......

if the source it is in the other machine and you want pull it from or download it whatever you want to call it you should do

rsync -avzP userontheremotemachine@ip.remote.machine:/path/to/folder/to/sync "/folder/where/it/is/going/to/be" 

I hope this help you a bet !

rsync -avzP  

-a archive mode; equals -rlptgoD (no -H,-A,-X)
-v increase verbosity
-z compress file data during the transfer
-P show progress during transfer
-s no space-splitting; wildcard chars only

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.