wiki:Zync

Version 1 (modified by omry, 10 years ago) (diff)

--

Zync is a Java program that combines the power of rsync and zfs snapshots to backup remote servers. Configuration is very easy, and once configured, all you need to do is to add it to cron to be executed as often as you would like.

When Zync is executed, it performs rsync syncrhonzation of the specified servers, and when it's down it takes a ZFS snapshot of the current state. snapshots contains a timestamp for easy recognition:

$ ls -1 /storage/backup/.zfs/snapshot/
2009_08_08__16_13_29_IDT
2009_08_08__16_13_34_IDT
2009_08_08__16_13_47_IDT

Zync can automatically delete snapshots older than a particular time (older than X days, hours or minutes). this ensures that your backup directory does not grows indefinitely.

Build instructions

Check out from repository, and build using ant (you need Build, jdk and ant installed):

$ svn co http://svn.firefang.net/trunk/zync
$ cd zync
$ ant

generated files will be placed in a new build directory inside the project directory.

Configuration

Copy the sample.conf to backup.conf, and edit it to match your setup. A typical backup block to backup and entire server root directory may look like:

backup
{
        host : root@10.0.0.2
        directory : /

        # Exclude files or dirs
        exclude
        {
                /cdrom
                /mnt
                /dev
                /home/*/temp
                /media
                /proc
                /sys
                /tmp
                /var/cache
                /var/log
                /var/lib/mysql
        }
}

You can have multiple backup blocks to backup more than one server.

Typically, you would want to setup the server that runs Zync so that it can access the backed-up machines without having to type a password. see PasswordLessSSHLogic for more information.

Running

java -jar zync-version.jar [-v|--verbose] [--file=backup_configuration_file]

by default:

  • verbose is off
  • backup file is backup.conf