[Borgbackup] Syncing directories with Borgbackup
Bzzzz
lazyvirus at gmx.com
Thu Nov 7 12:51:09 EST 2019
On Thu, 7 Nov 2019 11:08:40 -0600
Joseph Hesse <joehesse at gmail.com> wrote:
> I have done a successful borg backup of my home directory on PC1. I
> want to use this backup to synchronize (like rsync) my home directory
> on PC1 to the home directory on PC2.
>
> I plan to do this by using "borg mount" on PC2 to mount my latest
> backup from PC1 to /tmp, on PC2, and then manually copy (cp -a -r -u)
> the home directory in /tmp to /home.
>
> My question is: Is this the best way to do this?
No, you should write scripts triggered by a crontab to automatize all
that.
On each of my machine, I've got /BORG on which is NFS mounted the
machine's repo just before a new backup is performed
and /SSHFS where I can mount a specific borg backup.
You could go on with the same, then measure the time taken for each
action (add 33-50% for security), and create crontabs as follow:
PC1:
* borg create /home /BORG
* wait until avg time taken to backup+NN% is reached
PC2:
* borg mount backsrv::PC1/home_date (last backup) on
/SSHFS
* rsync from /SSHFS to /home OR cp -au /SSHFS/* /home
Side effect of scripting: you do not care about databases (especially
them, because all of them can't be faithfully binary-backup when running)
because your scripts: check if a DB is running, if so, stop it,
perform backup|restore, restart DB engine is it was running formerly.
Jean-Yves
More information about the Borgbackup
mailing list