0

I have configured Unison for synchronising files among servers. It takes a copy of a file from SERVER1 and replaces or copies the file to the other servers. I just added a folder directly onto SERVER2, but SERVER1 (the base server) had an older copy of that folder and its contents. After using Unison to synchronise all of my files to SERVER2, that folder was replaced by the older folder from SERVER1.

Is there any way to recover files from SERVER2? Does Unison itself maintain some version control or backups?

Mike Pierce
  • 1,390
  • 1
  • 12
  • 35
Prashant Shukla
  • 329
  • 1
  • 2
  • 17

1 Answers1

2

Depending on your configuration, Unison should register this as a conflict where you would manually need to tell it to push the files from SERVER1 to SERVER2. Unison does not maintain backups by default, so unless you have enabled this, the files on SERVER2 have been overwritten.


To enable backups in Unison, you need to have something like this in your Unison profile:

backuplocation = central
backupdir = Unison-Backups
backup = Name {.*,*}
maxbackups = 7
backupprefix = 
backupsuffix = .$VERSION

This will make backups of up to 7 versions of every file and put those backups in the Unison-Backups directory and will append the version number to the name of each backed-up file. See this section of the Unison manual for more details.

Mike Pierce
  • 1,390
  • 1
  • 12
  • 35