@@ -38,6 +38,7 @@ opt_send_type=''
3838opt_send_host=' '
3939opt_recv_pool=' '
4040opt_send_opts=' '
41+ opt_send_only=' '
4142opt_recv_opts=' '
4243opt_send_ssh_opts=' '
4344opt_send_mbuf_opts=' '
@@ -85,6 +86,7 @@ print_usage ()
8586 --send-ssh-opts Option(s) passed to 'ssh'.
8687 --send-mbuf-opts Use mbuffer (with these options) between 'zfs send'
8788 and 'ssh <host> zfs receive'.
89+ --send-only Only send the the most recent snapshot
8890 --sep=CHAR Use CHAR to separate date stamps in snapshot names.
8991 -g, --syslog Write messages into the system log.
9092 -r, --recursive Snapshot named filesystem and all descendants.
@@ -196,6 +198,21 @@ $ii@$NAME"
196198 fi
197199 fi
198200
201+ if [ -n " $opt_send_only " ]
202+ then
203+ for jj in $SNAPSHOTS_OLD
204+ do
205+ echo $SNAPS_DONE | grep -qv $ii
206+ if [ -z " ${jj# $ii @ $GLOB } " -a $? -eq 0 ]
207+ then
208+ SNAPS_DONE=" $SNAPS_DONE
209+ $jj "
210+ echo adding $jj
211+ fi
212+ done
213+ continue ;
214+ fi
215+
199216 # Retain at most $opt_keep number of old snapshots of this filesystem,
200217 # including the one that was just recently created.
201218 test -z " $opt_keep " && continue
@@ -338,7 +355,7 @@ GETOPT=$(getopt \
338355 --longoptions=pre-snapshot:,post-snapshot:,destroy-only \
339356 --longoptions=send-full:,send-incr:,send-opts:,recv-opts: \
340357 --longoptions=send-ssh-opts:,send-mbuf-opts:,pre-send:,post-send: \
341- --longoptions=send-fallback \
358+ --longoptions=send-fallback,send-only \
342359 --options=dnshe:l:k:p:rs:qgv \
343360 -- " $@ " ) \
344361 || exit 128
443460 opt_send_fallback=1
444461 shift 1
445462 ;;
463+ (--send-only)
464+ opt_send_only=1
465+ opt_do_snapshots=' '
466+ shift 1
467+ ;;
446468 (--send-opts)
447469 opt_send_opts=" $2 "
448470 shift 2
0 commit comments