aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2014-06-05 21:27:25 +0200
committerMirek Kratochvil <exa.exa@gmail.com>2014-06-05 21:27:25 +0200
commit36de0d4c62624524f4f2c44001cdc779f50131a0 (patch)
tree8a4ce513c840a6a3e44c8405b93fed156eaac365
parentbe5802b1204f48d8bb67a86343a2cfe930f4c323 (diff)
downloadzfs-backup-36de0d4c62624524f4f2c44001cdc779f50131a0.tar.gz
zfs-backup-36de0d4c62624524f4f2c44001cdc779f50131a0.tar.bz2
prevent accidental destruction of everything
-rwxr-xr-xzb-cleanup5
1 files changed, 5 insertions, 0 deletions
diff --git a/zb-cleanup b/zb-cleanup
index 5f7c07b..fbefd4d 100755
--- a/zb-cleanup
+++ b/zb-cleanup
@@ -5,6 +5,11 @@ if [[ -z "$1" || -z "$2" ]] ; then
exit 1
fi
+if [[ "$2" -lt 100 ]] ; then
+ echo "density must not be lower than 100" >&2
+ exit 2
+fi
+
timestamp () {
t="`echo \"$1\" |sed -ne 's/^.*@zb-//p' |tr 'p_' '+ '`"
[[ -z "$t" ]] && return 1