/[sysadmin-cookbook]/recepies/btrfs/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/btrfs/pull-snapshot-backup.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 73 - (hide annotations)
Sat May 16 12:38:41 2009 UTC (14 years, 11 months ago) by dpavlin
File MIME type: application/x-sh
File size: 523 byte(s)
example script to pull backup over rsync and create btrfs snapshot

1 dpavlin 73 #!/bin/sh -x
2    
3     from=koha-hw.ffzg.hr
4     date=`date +%Y-%m-%d`
5     pool=btrfs
6     log=/var/log/
7    
8     function rsync_veid() {
9     rsync -ravHC --numeric-ids --delete $from:/mnt/vz-backup/private/$1/ /$pool/$1/ && btrfsctl -s /$pool/backup/$1@$date /btrfs/$1/
10     }
11    
12     (
13     df -h /$pool
14     ssh $from 'sync && sync && lvcreate -s -L 10G -n vz-backup /dev/vg/vz && mount /dev/vg/vz-backup /mnt/vz-backup/' || exit
15     rsync_veid 212226
16     rsync_veid 212052
17     ssh $from 'umount /mnt/vz-backup/ && lvremove -f /dev/vg/vz-backup'
18     df -h /$pool
19     ) | tee -a $log/$0.$date.log

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26