add some useful error messages
This commit is contained in:
		
							parent
							
								
									3ee8104210
								
							
						
					
					
						commit
						22cc3842a0
					
				| 
						 | 
					@ -40,7 +40,7 @@ done |sort -n | while read l ; do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if [ "$curtime" -lt "$max_age" ] ; then
 | 
						if [ "$curtime" -lt "$max_age" ] ; then
 | 
				
			||||||
		#too old
 | 
							#too old
 | 
				
			||||||
		zfs destroy "$snapname"
 | 
							zfs destroy "$snapname" || echo "$0: zfs destroy $snapname failed" >&2
 | 
				
			||||||
		continue
 | 
							continue
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,7 +52,7 @@ done |sort -n | while read l ; do
 | 
				
			||||||
	#if it's too dense, delete the closer snapshot
 | 
						#if it's too dense, delete the closer snapshot
 | 
				
			||||||
	if [ $(( ($density*($curtime-$lasttime))/($timenow-$lasttime) )) -lt 100 ]
 | 
						if [ $(( ($density*($curtime-$lasttime))/($timenow-$lasttime) )) -lt 100 ]
 | 
				
			||||||
	then
 | 
						then
 | 
				
			||||||
		zfs destroy "$snapname"
 | 
							zfs destroy "$snapname" || echo "$0: zfs destroy $snapname failed" >&2
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		lasttime="$curtime"
 | 
							lasttime="$curtime"
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								zb-pull
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								zb-pull
									
									
									
									
									
								
							| 
						 | 
					@ -63,6 +63,8 @@ else
 | 
				
			||||||
	ret=$?
 | 
						ret=$?
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[ "$ret" != 0 ] && echo "pulling to ${local_zfs} failed" >&2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#in some cases and on some setups (Sun_SSH) when `zfs recv` fails, ssh ignores
 | 
					#in some cases and on some setups (Sun_SSH) when `zfs recv` fails, ssh ignores
 | 
				
			||||||
#the SIGPIPE and the connection hangs there forever, somehow. This fixes the
 | 
					#the SIGPIPE and the connection hangs there forever, somehow. This fixes the
 | 
				
			||||||
#issue by killing all children that were possibly spawned by this shell.
 | 
					#issue by killing all children that were possibly spawned by this shell.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue