aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2015-12-26 18:28:34 +0100
committerMirek Kratochvil <exa.exa@gmail.com>2015-12-26 18:28:34 +0100
commit03c571e99e9cf34419d603e5b6e8a982430caeb2 (patch)
treea3683daaec2c55fcee0d818a379df95393e665f2
parentcd769a1d45c9ef4d71551c9087a24aff85bfbdfa (diff)
downloadzfs-backup-03c571e99e9cf34419d603e5b6e8a982430caeb2.tar.gz
zfs-backup-03c571e99e9cf34419d603e5b6e8a982430caeb2.tar.bz2
workaround old bashism by a new bashism
-rwxr-xr-xzb-pull13
1 files changed, 7 insertions, 6 deletions
diff --git a/zb-pull b/zb-pull
index d148a6f..2f8eca2 100755
--- a/zb-pull
+++ b/zb-pull
@@ -24,11 +24,7 @@ local_zfs="$3"
newest="N/A"
newest_common="N/A"
-ssh $ssh_remote "zfs list -t snapshot -r -d 1 -H \"${remote_zfs}\" " | awk '{print $1;}' | while read l ; do
- #link unix timestamps
- unixtime=`timestamp "$l"` || continue
- echo "$unixtime" "$l"
-done | sort -n | while read l ; do
+while read l ; do
fullname=${l#* }
snapname=${fullname#*@zb-}
@@ -37,7 +33,12 @@ done | sort -n | while read l ; do
if zfs list -t snapshot -H "${local_zfs}@zb-${snapname}" ; then
newest_common="$snapname"
fi >/dev/null 2>/dev/null
-done
+done < <(
+ssh $ssh_remote "zfs list -t snapshot -r -d 1 -H \"${remote_zfs}\" " | awk '{print $1;}' | while read l ; do
+ #link unix timestamps
+ unixtime=`timestamp "$l"` || continue
+ echo "$unixtime" "$l"
+done | sort -n )
# some checks