Page 1 of 1
ZFS Snapshots and Replication vs RSync vs Unison
Posted: 16 Apr 2013 12:05
by StylusPilot
Hi,
coming from FreeNAS which had the ability to use ZFS Replication, is this something coming to NAS4Free
Can anyone shed some light on when's the best time to use Unison, RSync or ZFS Replication
* Which is better for lower speed links
* Which transfers less data
* Which is overall quicker
* Is there one more stable than others
Thanks
Re: ZFS Snapshots and Replication vs RSync vs Unison
Posted: 22 Apr 2013 22:05
by danic
To my knowledge ZFS Replication (zfs send / zfs recv? correct?) is available via command line. That ability does exist in nas4free.
As for which transfers less data, I believe rsync and zfs snapshots with zfs send/zfs recv will use the same amount of data, as they both have the options to send only data that has changed since last ran. But if you are dealing with large flat files, I bet zfs method would be more efficient. I have not tested it, but ZFS snapshots I think are block level not file level. So large files that change, ZFS should be able to send the new device level blocks instead of the whole file.
That's all I can add. Give each type a try and report back. Let us know what you find works best in your situation.
Re: ZFS Snapshots and Replication vs RSync vs Unison
Posted: 03 May 2013 21:32
by dw5304
zfs is def just a zfs send and zfs receive.
I have already talked to dev's about adding it to the webgui... no one has yet said yes... however I do have a script that I have been running to do just this its not as many snapshots only 1 - 7 one for each day of work but it can be used to expand out more if necessary. I will post the bash script soon.
Re: ZFS Snapshots and Replication vs RSync vs Unison
Posted: 04 Jun 2013 18:48
by dw5304
i ended up finding the script
Code: Select all
#!/bin/sh
/usr/bin/logger -p local4.notice "Start of local RSYNC from /mnt/main/ to /mnt/rsync/"
if [ -r /var/run/rsync_local_running_972d449a-eb43-4be8-ad5a-72377444e8aa ]; then
/usr/bin/logger -p local4.notice "Previous local synchronization still running... exiting"
exit
fi
/usr/bin/logger -p local4.notice "Starting zfs backup."
zfs destroy backup/data@7daysago
zfs destroy main@7daysago
zfs rename backup/data@6daysago backup/data@7daysago
zfs rename main@6daysago main@7daysago
zfs rename backup/data@5daysago backup/data@6daysago
zfs rename main@5daysago main@6daysago
zfs rename backup/data@4daysago backup/data@5daysago
zfs rename main@4daysago main@5daysago
zfs rename backup/data@3daysago backup/data@4daysago
zfs rename main@3daysago main@4daysago
zfs rename backup/data@2daysago backup/data@3daysago
zfs rename main@2daysago main@3daysago
zfs rename backup/data@yesterday backup/data@2daysago
zfs rename main@yesterday main@2daysago
zfs rename backup/data@now backup/data@yesterday
zfs rename main@now main@yesterday
zfs snapshot main@now
zfs send -i main@yesterday main@now | zfs receive backup/data
/usr/bin/touch /var/run/rsync_local_running_972d449a-eb43-4be8-ad5a-72377444e8aa
/usr/bin/logger -p local4.notice "Loading Fuse"
/sbin/kldload fuse
/bin/mkdir /mnt/rsync
/usr/bin/logger -p local4.notice "Attaching hdd to computer"
/sbin/atacontrol attach ata5
/usr/bin/logger -p local4.notice "Mounting NTFS drive"
/sbin/mount_ntfs-3g /dev/ad10s1 /mnt/rsync
/bin/sleep 5
/usr/local/bin/rsync --log-file=/var/log/rsync_local.log --recursive --times --archive --delete --perms --xattrs "/mnt/main/" "/mnt/rsync/"
/usr/bin/logger -p local4.notice "Unmounting Rsync backup drive"
/sbin/umount /mnt/rsync
/usr/bin/logger -p local4.notice "Detaching hdd from server"
/sbin/atacontrol detach ata5
/bin/rm -r -f /mnt/rsync
/bin/rm -f /var/run/rsync_local_running_972d449a-eb43-4be8-ad5a-72377444e8aa
/usr/bin/logger -p local4.notice "End of local RSYNC synchronization from /mnt/main/ to /mnt/rsync/
"