/[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 48 - (hide annotations)
Sun May 10 13:43:03 2009 UTC (13 years ago) by dpavlin
File MIME type: application/x-sh
File size: 650 byte(s)
delete files which are removed at source location

1 dpavlin 46 #!/bin/sh -x
2    
3     from=koha-hw.ffzg.hr
4     date=`date +%Y-%m-%d`
5     pool=opl
6     log=/$pool/log/
7    
8     (
9     zfs list -r $pool/backup | tee $log/zfs-list.before
10     ssh $from 'sync && sync && lvcreate -s -L 10G -n vz-backup /dev/vg/vz && mount /dev/vg/vz-backup /mnt/vz-backup/' || exit
11 dpavlin 48 rsync -ravHC --delete $from:/mnt/vz-backup/private/212226/ /$pool/backup/212226/ && zfs snapshot $pool/backup/212226@$date
12     rsync -ravHC --delete $from:/mnt/vz-backup/private/212052/ /$pool/backup/212052/ && zfs snapshot $pool/backup/212052@$date
13 dpavlin 46 ssh $from 'umount /mnt/vz-backup/ && lvremove -f /dev/vg/vz-backup'
14     zfs list -r $pool/backup | tee $log/zfs-list.after
15     ) | tee $log/$0.$date.log

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26