0

I want to synchronize two computers that are similar and update just a few files. Therefore I would like to perform a Unison and ignore everything except a list of files in different paths.

Something like:

# /usr/bin/unison-gtk /home/ ssh://root@192.168.0.199:22//home/ -ignore "Name *" -ignorenot "Name {config/text.cfg, Pictures/test.jpg, Desktop/test.mp3"

Or even better starting with root directory:

# /usr/bin/unison-gtk / ssh://root@192.168.0.199:22// -ignore "Name *" -ignorenot "Name {/home/config/text.cfg, /home/Pictures/test.jpg, /usr/local/bin/test.sh"

The first ignore is exclude everything else so the ignorenot won't catch them. Any Help? Can anyone help? Nothing I have found is helping me.

kaya3
  • 47,440
  • 4
  • 68
  • 97
  • 1
    At first glance that should work. What happened when you tried it? I noticed the pattern in your `-ignorenot` is not properly terminated; there is a missing closing brace. Also, have you checked the documentation for the `-path` command-line option? (Hint: when you come back with more information, please update your answer.) – Edward Nov 19 '21 at 14:41
  • Also, please verify whether the spaces after the commas are interpreted literally. You may want to experiment with removing them. Can't check the documentation right now. – Edward Nov 19 '21 at 14:43
  • The closing brace was during adjustments for this page as I don't want to post the original files or IP and so on. No, it does not work, as the first ignore is ruling first. – Diewo Dasso Nov 23 '21 at 20:15

1 Answers1

1

Got the solution somewhere else. Using path multiple times is possible:

/usr/bin/unison-gtk / ssh://root@192.168.0.100:22// -path home/config/text.cfg -path /home/Pictures/test.jpg -path /usr/local/bin/test.sh"
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77