Changes between Version 22 and Version 23 of Documentation


Ignore:
Timestamp:
May 3, 2013, 4:54:26 AM (6 years ago)
Author:
bruno
Comment:

Add modify_iso script example

Legend:

Unmodified
Added
Removed
Modified
  • Documentation

    v22 v23  
    236236echo "Backup over"
    237237}}}
     238
     239Here is a script example "modify_iso" showing how to to filter out all references to Serviceguard volume groups and
     240disks so recovery program had easier situation. The script is called from mondoarchive's "-B" switch and it need scratch dir as only argument. Example: -B "/scripts/modify_iso /tmp/mondo.$$" (Contribution from Jan Derfinak)
     241{{{
     242#!/bin/bash
     243
     244DENY_VG="vg01|vg02|vg03|vg_test"
     245
     246if [ ! -f $1/mondo.scratch.*/mondo.scratch.*/images/all.tar.gz ]; then
     247  exit 0
     248fi
     249
     250mkdir -p /tmp/mondo.modify_iso.$$
     251cd /tmp/mondo.modify_iso.$$
     252tar -xzf $1/mondo.scratch.*/mondo.scratch.*/images/all.tar.gz
     253cd tmp
     254grep -v /dev/mapper/mpath < mountlist.txt > mountlist.txt~ && mv mountlist.txt~ mountlist.txt
     255awk '{gsub(/\/dev\/mapper\/mpath[[:alnum:]]*/, ""); print}' < i-want-my-lvm | grep -E -v -e /dev/mpath/mpath -e "($DENY_VG)" > i-want-my-lvm~ && mv i-want-my-lvm~ i-want-my-lvm
     256cd ..
     257tar -czf $1/mondo.scratch.*/mondo.scratch.*/images/all.tar.gz *
     258cd /tmp
     259rm -rf /tmp/mondo.modify_iso.$$
     260}}}
     261
    238262= Restoration =
    239263