]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - db/xfs_metadump.sh
xfsprogs: Release v6.8.0
[thirdparty/xfsprogs-dev.git] / db / xfs_metadump.sh
CommitLineData
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
7OPTS=" "
8DBOPTS=" "
b09e839e 9USAGE="Usage: xfs_metadump [-aefFogwV] [-m max_extents] [-l logdev] source target"
61983f67 10
0323bbf6 11while getopts "aefgl:m:owFv:V" c
61983f67
BN
12do
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";;
0323bbf6 23 v) OPTS=$OPTS"-v "$OPTARG" ";;
61983f67
BN
24 V) xfs_db -p xfs_metadump -V
25 status=$?
26 exit $status
27 ;;
28 \?) echo $USAGE 1>&2
29 exit 2
30 ;;
31 esac
32done
33set -- extra $@
34shift $OPTIND
35case $# in
4e83ac7b 36 2) xfs_db$DBOPTS -i -p xfs_metadump -c "metadump$OPTS $2" $1
61983f67
BN
37 status=$?
38 ;;
39 *) echo $USAGE 1>&2
40 exit 2
41 ;;
42esac
43exit $status