]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - db/xfs_metadump.sh
xfs: zero length symlinks are not valid
[thirdparty/xfsprogs-dev.git] / db / xfs_metadump.sh
1 #!/bin/sh -f
2 # SPDX-License-Identifier: GPL-2.0
3 #
4 # Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
5 #
6
7 OPTS=" "
8 DBOPTS=" "
9 USAGE="Usage: xfs_metadump [-aefFogwV] [-m max_extents] [-l logdev] source target"
10
11 while getopts "aefgl:m:owFV" c
12 do
13 case $c in
14 a) OPTS=$OPTS"-a ";;
15 e) OPTS=$OPTS"-e ";;
16 g) OPTS=$OPTS"-g ";;
17 m) OPTS=$OPTS"-m "$OPTARG" ";;
18 o) OPTS=$OPTS"-o ";;
19 w) OPTS=$OPTS"-w ";;
20 f) DBOPTS=$DBOPTS" -f";;
21 l) DBOPTS=$DBOPTS" -l "$OPTARG" ";;
22 F) DBOPTS=$DBOPTS" -F";;
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
35 2) xfs_db$DBOPTS -i -p xfs_metadump -c "metadump$OPTS $2" $1
36 status=$?
37 ;;
38 *) echo $USAGE 1>&2
39 exit 2
40 ;;
41 esac
42 exit $status