]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - db/xfs_metadump.sh
xfsprogs: document environment variables
[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
b09e839e 11while getopts "aefgl:m:owFV" 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";;
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
31done
32set -- extra $@
33shift $OPTIND
34case $# 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 ;;
41esac
42exit $status