/[sysadmin-cookbook]/recepies/zfs/pull-snapshot-backup.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /recepies/zfs/pull-snapshot-backup.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (show annotations)
Sun May 17 15:26:05 2009 UTC (13 years, 6 months ago) by dpavlin
File MIME type: application/x-sh
File size: 627 byte(s)
use current pool on system, compress rsync
1 #!/bin/sh -x
2
3 from=koha-hw.ffzg.hr
4 date=`date +%Y-%m-%d`
5 pool=`zpool list -o name -H`
6 log=/$pool/log/
7
8 test -d $log || mkdir $log || exit
9
10 function rsync_veid() {
11 rsync -ravHz --numeric-ids --delete --force --modify-window=2 $from:/mnt/vz-backup/private/$1/ /$pool/backup/$1/ && zfs snapshot $pool/backup/$1@$date
12 }
13
14 (
15 zfs list -r $pool/backup
16 ssh $from 'sync && sync && lvcreate -s -L 10G -n vz-backup /dev/vg/vz && mount /dev/vg/vz-backup /mnt/vz-backup/' || exit
17 rsync_veid 212226
18 rsync_veid 212052
19 ssh $from 'umount /mnt/vz-backup/ && lvremove -f /dev/vg/vz-backup'
20 zfs list -r $pool/backup
21 2>&1 ) | tee -a $log/$date.log

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26