]>
Commit | Line | Data |
---|---|---|
61983f67 BN |
1 | #!/bin/sh -f |
2 | # | |
3 | # Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved. | |
4 | # | |
5 | ||
6 | OPTS=" " | |
7 | DBOPTS=" " | |
b09e839e | 8 | USAGE="Usage: xfs_metadump [-aefFogwV] [-m max_extents] [-l logdev] source target" |
61983f67 | 9 | |
b09e839e | 10 | while getopts "aefgl:m:owFV" c |
61983f67 BN |
11 | do |
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 | |
30 | done | |
31 | set -- extra $@ | |
32 | shift $OPTIND | |
33 | case $# 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 | ;; | |
40 | esac | |
41 | exit $status |