/[sysadmin-cookbook]/recepies/zfs/pull-rsync-snap.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-rsync-snap.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 198 - (show annotations)
Wed Mar 31 06:15:41 2010 UTC (14 years ago) by dpavlin
File MIME type: application/x-sh
File size: 672 byte(s)
pull btrfs snapshot from rsync server

1 #!/bin/sh -x
2
3 from=10.60.0.200
4
5 pool=`zpool list -o name -H`
6 log=/$pool/log/
7
8 exclude='--exclude var/cache --exclude var/lib/koha/zebradb/biblios --exclude data/webpac2/var/'
9
10 function rsync_veid() {
11
12 veid=$1
13 host=$2
14
15 date_time=`rsync $from::mnt/$host/.snap/ | tail -1 | awk '{ print $5 }'`
16 date=`echo $date_time | cut -dT -f1`
17
18 (
19 rsync $exclude -ravHz --numeric-ids --delete --force --modify-window=2 \
20 $from::mnt/$host/.snap/$date_time/ \
21 /$pool/backup/$veid/ \
22 && zfs snapshot $pool/backup/$veid@$date
23 2>&1 ) | tee -a $log/$date.log
24
25 }
26
27 rsync_veid 212052 koha-dev
28 rsync_veid 212056 webpac2
29 rsync_veid 212226 koha
30
31 #zfs list -r $pool/backup | tee -a $log/$date.log
32

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26