[[ $# -ne 2 ]] && \ die "usage: $0 " [[ -a $2 ]] && \ die "$1 already exists" [[ -d $1 ]] || \ die "$1 is not valid directory" btrfs subvolume snapshot $1 $2 || die "btrfs snapshot failed"