BackupsMSL: verschil tussen versies

Uit MakerSpace Leiden
Ga naar: navigatie, zoeken
(deur-db 192.168.4.2)
Regel 27: Regel 27:
 
   /home/mvn/backup.sh
 
   /home/mvn/backup.sh
  
which does an incremental backup (rsync) of all mounted EXT4 volumes.
+
which does an incremental backup (rsync) of all mounted EXT4 volumes - excluding the devices:
 +
 
 +
  #!/bin/sh
 +
  mount -t ext4 | awk '{print  $3 }' | while read dir
 +
  do
 +
rsync -Caz $dir --exclude '/proc/**' --exclude '/dev/**' --exclude '/sys/**' backup-msl:/usr/home/backup-msl/msl-deurdb
 +
  done
 +
 
 +
This is called by crontab:
 +
 
 +
  MAILTO=xxx@xxxx.com
 +
  0 3 * * * test -x /home/mvn/backup.sh && /home/mvn/backup.sh > /var/log/backup.log 2&>1
 +
 
 +
with a quick sentinel and we're keeping a log of the most recent backups.
  
 
== Destination ==
 
== Destination ==

Versie van 20 feb 2018 om 15:35

Backup setup (temporary).

Common setup

A pub/private keypair; with a blind, incremental rsync over ssh.

It relies on

 .ssh/config
 .ssh/id_rsa

for its config and data.

main host 192.168.5.1

File in

/usr/local/etc/periodic/daily/999.backup

which does an incremental backup (rsync) of all mounted UFS volumes.

deur-db 192.168.4.2

File in

 /home/mvn/backup.sh

which does an incremental backup (rsync) of all mounted EXT4 volumes - excluding the devices:

 #!/bin/sh
 mount -t ext4 | awk '{print  $3 }' | while read dir
 do

rsync -Caz $dir --exclude '/proc/**' --exclude '/dev/**' --exclude '/sys/**' backup-msl:/usr/home/backup-msl/msl-deurdb

 done

This is called by crontab:

 MAILTO=xxx@xxxx.com
 0 3 * * * test -x /home/mvn/backup.sh && /home/mvn/backup.sh > /var/log/backup.log 2&>1

with a quick sentinel and we're keeping a log of the most recent backups.

Destination

On the destination server:

 command="/usr/local/bin/rsync --server  -logDtprCze.iLsfxC . backup-msl/msl-main",,restrict,no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa ....

backed by an encrypted FS with a daily snapshot; copy onto tape. 5 year rotation.