We want to copy ~800GB of data from a source server to destination server using rsync. I was wondering if its safe to use rsync without shutting down source server application? Can rsync handle real time data inflow on source while it copies/syncs the data back to destination server?
For backups and real-time synchronization I use
glusterfs. Is a very friendly and robust sync & backup package.
See more about
glusterfs in here.
Rsync "handles" it by ignoring it. Does that count? Not really... Any changes that get made after rsync copies that portion of the file are lost and not copied. This can mean that different parts of the same file contain data from different points in time.
As you suspected, this can be a problem.
A workaround I often use on linux (saw your tag) is to create an LVM snapshot, mount that read-only, then copy the snapshot data. An LVM snapshot is guaranteed to be unchanging for the lifetime of the snapshot, but it must be sized to hold enough of the changed data (writes.) When an LVM snapshot fills, it becomes unavailable.
# lvcreate --snapshot /dev/vgName/lvName --size 1G --name snapNameDate # mkdir /snaps # mkdir /snaps/lvName/Mount/Point # mount -o ro /dev/vgName/snapNameDate /snaps/lvName/Mount/Point # cd /snaps/lvName/Mount/Point # rsync --archive --verbose --progress . user@destination:/destination/Point/. # cd / # umount /snaps/lvName/Mount/Point # lvremove /dev/vgName/snapNameDate