]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - db/xfs_metadump.sh
xfs_db: Don't ASSERT on unrecognized metadata
[thirdparty/xfsprogs-dev.git] / db / xfs_metadump.sh
CommitLineData
61983f67
BN
1#!/bin/sh -f
2#
3# Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
4#
5
6OPTS=" "
7DBOPTS=" "
b09e839e 8USAGE="Usage: xfs_metadump [-aefFogwV] [-m max_extents] [-l logdev] source target"
61983f67 9
b09e839e 10while getopts "aefgl:m:owFV" c
61983f67
BN
11do
12 case $c in
b09e839e 13 a) OPTS=$OPTS"-a ";;
61983f67
BN
14 e) OPTS=$OPTS"-e ";;
15 g) OPTS=$OPTS"-g ";;
88b8e1d6 16 m) OPTS=$OPTS"-m "$OPTARG" ";;
61983f67
BN
17 o) OPTS=$OPTS"-o ";;
18 w) OPTS=$OPTS"-w ";;
19 f) DBOPTS=$DBOPTS" -f";;
20 l) DBOPTS=$DBOPTS" -l "$OPTARG" ";;
4e83ac7b 21 F) DBOPTS=$DBOPTS" -F";;
61983f67
BN
22 V) xfs_db -p xfs_metadump -V
23 status=$?
24 exit $status
25 ;;
26 \?) echo $USAGE 1>&2
27 exit 2
28 ;;
29 esac
30done
31set -- extra $@
32shift $OPTIND
33case $# in
4e83ac7b 34 2) xfs_db$DBOPTS -i -p xfs_metadump -c "metadump$OPTS $2" $1
61983f67
BN
35 status=$?
36 ;;
37 *) echo $USAGE 1>&2
38 exit 2
39 ;;
40esac
41exit $status