scripts

Random scripts
git clone git://git.margiolis.net/scripts.git
Log | Files | Refs | README | LICENSE

commit 09043167c10037615c1c759bc4d54d23756c06c7
parent 9905633c480e478151865b3eaeb9b804d3fe567a
Author: Christos Margiolis <christos@margiolis.net>
Date:   Sun,  3 Apr 2022 22:57:46 +0300

too many commits

Diffstat:
Mbackup | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/backup b/backup @@ -51,11 +51,8 @@ nsnaps=$(zfs list -t snapshot -o name ${dst_pool} | sed 1d | wc -l) # Make appropriate checks before creating new snapshot. # If the snapshot already exists, either renew it or exit. if [ "${src_last_snap}" = "${new_snap}" ]; then - if [ ${f_snap} -eq 1 ]; then - zfs destroy -r ${src_pool}@${new_snap} - else - err "snapshot ${new_snap} exists already" - fi + test ${f_snap} -eq 1 || err "snapshot ${new_snap} exists already" + zfs destroy -r ${src_pool}@${new_snap} fi zfs snapshot -r ${src_pool}@${new_snap}