3

I am trying to automate backup of my project folders through a script. I found Unison, which seemed to match my needs, and have writtenm a script that can reliably mount and unmount a samba folder (Mac backing up to a Windows box). The only problem I am having is getting my unison command to reliably backup my (currently test) directory. It says:

Looking for changes
Reconciling changes
Nothing to do: replicas have not changed since last sync.

Which doesn't make sense to me.

Here is my command:

unison ~/Documents/test  ~/hm_mnt/test/ -fat -auto -force ~/Documents/test -noupdate ~/Documents/test -nodeletion ~/Documents/test

I want to simply maintain a copy of the current state of my test folder in this case. this worked once and has not duplicated since.

My initial run (with slightly different command run fine) and I have been refining it to the above state since trying to get manual updates to a test file to move over. These have not propagated, and even when I cleaned out the remote folder to make sure there was no differences detected.

Thanks

river226
  • 73
  • 12
  • I assume that you've manually changed something in `~/Documents/test/*` made sure it hasn't changed in `~/hm_mnt/test/` and then run Unison and checked in `~/hm_mnt/test/` again to see if the changes were propagated? – Mike Pierce Nov 24 '17 at 19:02
  • I added more information to clarify. – river226 Nov 24 '17 at 19:07
  • Weird. It looks like Unison thinks it's copied the files somewhere though. Can you look in the directory `~/hm_mnt/test/` when the samba folder isn't mounted there? Maybe it's just not mounting properly and Unison is syncing with that *directory*. – Mike Pierce Nov 24 '17 at 19:15
  • Some other comments/questions: Why are you using the `-fat` flag? Is your Mac or Windows filesystem really formatted in FAT? And if you don't expect things to change on your Windows box, then you really don't need to specify any of the flags `-force`, `-noupdate`, or `-nodeletion`. – Mike Pierce Nov 24 '17 at 19:19
  • Also, for the sake of debugging, did you know that you can put all these parameters (with a little editing) into the file `~/.unison/default.prf`? Then you can just run the command `unison` and it will use these options by default. See [here for sample profiles](http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#profileegs). – Mike Pierce Nov 24 '17 at 19:19
  • Folder looks to be empty when unmounted ls -a ~/hm_mnt/ . .. And I get the same result with: unison ~/Documents/test ~/hm_mnt/test – river226 Nov 24 '17 at 20:00
  • Then I'm not sure. While you are debugging this, remember that you can delete the archive files in `~/.unison` (it'll be the file with a long hash-like filename) to sync "from scratch." Where is this archive file being stored on your Windows box? – Mike Pierce Nov 24 '17 at 21:07
  • I am trying to treat this as a local folder, not a remote folder as far as unison is concerned so it's not storing any that I can see. – river226 Nov 24 '17 at 21:45
  • @river226 Add `-ignorearchives` to prevent Unison from using its cached information. – David Nov 16 '18 at 09:50
  • In my experience Unison gives that (seemingly false) notice when your directories are off. If you do `ls` on your Mac, can you access all those directories as you have entered them above? – sakumatto Dec 27 '18 at 11:36

0 Answers0