| 238 | |
| 239 | Here is a script example "modify_iso" showing how to to filter out all references to Serviceguard volume groups and |
| 240 | disks 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 | |
| 244 | DENY_VG="vg01|vg02|vg03|vg_test" |
| 245 | |
| 246 | if [ ! -f $1/mondo.scratch.*/mondo.scratch.*/images/all.tar.gz ]; then |
| 247 | exit 0 |
| 248 | fi |
| 249 | |
| 250 | mkdir -p /tmp/mondo.modify_iso.$$ |
| 251 | cd /tmp/mondo.modify_iso.$$ |
| 252 | tar -xzf $1/mondo.scratch.*/mondo.scratch.*/images/all.tar.gz |
| 253 | cd tmp |
| 254 | grep -v /dev/mapper/mpath < mountlist.txt > mountlist.txt~ && mv mountlist.txt~ mountlist.txt |
| 255 | awk '{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 |
| 256 | cd .. |
| 257 | tar -czf $1/mondo.scratch.*/mondo.scratch.*/images/all.tar.gz * |
| 258 | cd /tmp |
| 259 | rm -rf /tmp/mondo.modify_iso.$$ |
| 260 | }}} |
| 261 | |