/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 242 - (hide annotations)
Sun Feb 13 19:39:00 2011 UTC (11 years, 3 months ago) by dpavlin
File MIME type: application/x-sh
File size: 941 byte(s)
remove function bash-isam
1 dpavlin 46 #!/bin/sh -x
2    
3 dpavlin 205 # prod.vbz.ffzg.hr
4     from=10.60.0.200
5     vg=/dev/raid5
6    
7 dpavlin 46 date=`date +%Y-%m-%d`
8 dpavlin 82 pool=`zpool list -o name -H`
9 dpavlin 46 log=/$pool/log/
10 dpavlin 205 exclude='--exclude var/cache --exclude var/lib/koha/zebradb/biblios --exclude data/webpac2/var/ --exclude tmp/'
11 dpavlin 46
12 dpavlin 82 test -d $log || mkdir $log || exit
13    
14 dpavlin 242 rsync_veid() {
15 dpavlin 217 ssh $from "umount /mnt/backup/$2 ; lvremove -f $vg/$2-backup"
16 dpavlin 205 ssh $from "sync && sync && lvcreate -s -L 10G -n $2-backup $vg/$2 && mount $vg/$2-backup /mnt/backup/$2" || exit
17 dpavlin 104 test -d /$pool/backup/$1 || zfs create $pool/backup/$1 || exit
18 dpavlin 145 echo "## rsync $1"
19 dpavlin 205 rsync $exclude -ravHz --numeric-ids --delete --force --modify-window=2 $from::mnt/backup/$2/rootfs/ /$pool/backup/$1/ && zfs snapshot $pool/backup/$1@$date
20 dpavlin 217 # ssh $from "umount /mnt/backup/$2 && lvremove -f $vg/$2-backup"
21 dpavlin 79 }
22    
23 dpavlin 46 (
24 dpavlin 79 zfs list -r $pool/backup
25 dpavlin 205 rsync_veid 212226 koha
26     rsync_veid 212052 koha-dev
27     rsync_veid 212056 webpac2
28 dpavlin 79 zfs list -r $pool/backup
29     2>&1 ) | tee -a $log/$date.log

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26