Open alexandreteles opened 9 years ago
Does this have any benefits compared to the current tar gzip / sftp stack?
As you are suposed to use this only for data replication (copy the backup files to a bunch of servers) Unison can provide some benefits over that stack:
For the points that require Unison to be installed at all machines, if it isn't installed at the machines that will receive the backup files, Unison will fallback and work with a less efficient way that don't provide that functionalities.
if it isn't installed at the machines that will receive the backup files, Unison will fallback and work with a less efficient way that don't provide that functionalities.
Which is?
As Unison can merge files, when using incremental backup Unison can send to the server only what was modified (will require Unison to be installed at all machines);
In this case Unison will send the entire file and overwrite the old copy at the destination server instead of merging files;
Unison is error resilient. If the transfering is interrupted, Unison will verify what was sent and send only what is needed to have the file completed on the other server (will require Unison to be installed at all machines);
In this case, Unison will delete the remote incomplete copy and start all again. If you are using Unison in such a scenario, you should add to the profile how many retries it should do:
retry = 10
The retry argument can be used in a scenario where you have Unison installed on the others machines too, but if you don't have, it's mandatory to set this argument in the profile.
When transferring more than one file, Unison will automatically parallelize the transferring to achieve a faster transference.
It will parallelize if you are transferring for more than one server too, even if you have just one file being synchronized.
I know that this is at your ToDo list for CDP, so I want to present you a really good way to make the backup replication using Unison ( http://www.cis.upenn.edu/~bcpierce/unison/ ). Unison is a tool that is available for Windows and present at the repositories of many flavors of Unix (Solaris, Linux, OS X, etc.) systems.
So, I will consider that you already have Unison installed (or know how to do this).
First of all you need to setup the UNISON environment variable at path to make sure that UNISON will look for *.prf (profile) files at the correct location, most preferable one that isn't world readable. So we will create the
unison
directory under/etc/
and add the UNISON variable to the env.:After that, we need to create a *.prf file to tell unison what will we ask him to do. This files are pretty simple to build and can make unison replicate the backups for more that one server at once. Let me show you a example. First of all we will create the .prf file inside of the /etc/unison/ directory:
Save this file as
/etc/unison/myfirstserver.com.prf
and now you can sync the files at this directory to all server pointed at the *.prf using:This should provide a exit just like that:
Unison will sync the file permissions and owner:group by default. So, if you are transfering files that will be put at a protected directory, the user that you are using to login at the SSH needs to have the right permissions. You can use all this options directly from a big command line, but this isn't really recomended.
This could be used to make the backup restauration as well. You just need to change the
root
options to match what you need.