Skip to content

Commit

Permalink
Fixed jf647#23, fixed exception if called with e.x. /btrfs/system/@root
Browse files Browse the repository at this point in the history
* fixed jf647#23
* Calling btrfs-snap `btrfs-snap -r -c -B /btrfs/system/snapshots
/btrfs/system/@root root_daily 7` throws `ERROR: /btrfs/system/@root is
not a btrfs mountpoint (or old version of btrfs-tools, try > 0.19)`.
Fixed jf647#24.
  • Loading branch information
kaotika committed Aug 15, 2018
1 parent 7126515 commit cfc87b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions btrfs-snap
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ if [ $# -ne 3 ] ; then
fi

# Remove trailing slash
mp=${1%/}
mp=$(realpath -s $1)
prefix=$2
cnt=$(( $3+1 ))

Expand All @@ -195,7 +195,7 @@ function log.error() {
mount -t btrfs | cut -d " " -f 3 | grep "^${mp}$" > /dev/null
if [ $? -ne 0 ] ; then
# or a valid snapshot matching mp
btrfs subvolume show $mp | grep "${mp}$" > /dev/null
btrfs subvolume show $mp | grep $(basename $mp) > /dev/null
if [ $? -ne 0 ] ; then
log.error "${mp} is not a btrfs mountpoint (or old version of btrfs-tools, try > 0.19)"
exit 1;
Expand Down

0 comments on commit cfc87b4

Please sign in to comment.