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