wip
This commit is contained in:
		
							parent
							
								
									8d843cd209
								
							
						
					
					
						commit
						a85782823e
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -32,12 +32,13 @@ zfs snap "$source_dataset@$new_bookmark" | |||
| if zfs list -t bookmark -H -o name | grep "^$source_dataset#$bookmark_prefix" | wc -l | grep -q "^0$" | ||||
| then | ||||
|   echo "INITIAL BACKUP" | ||||
|   zfs send -v "$source_dataset@$new_bookmark" | $ssh sudo zfs recv -F "$target_dataset" | ||||
|   # do in subshell, otherwise ctr+c will lead to 0 exitcode   | ||||
|   $(zfs send -v "$source_dataset@$new_bookmark" | $ssh sudo zfs recv -F "$target_dataset") | ||||
| else | ||||
|   echo "INCREMENTAL BACKUP" | ||||
|   last_bookmark=$(zfs list -t bookmark -H -o name | grep "^$source_dataset#$bookmark_prefix" | sort | tail -1 | cut -d '#' -f 2) | ||||
|   [[ -z "$last_bookmark" ]] && echo "ERROR - last_bookmark is empty" && exit 98 | ||||
|   zfs send -v -i "#$last_bookmark" "$source_dataset@$new_bookmark" | $ssh sudo zfs recv "$target_dataset" | ||||
|   $(zfs send -v -i "#$last_bookmark" "$source_dataset@$new_bookmark" | $ssh sudo zfs recv "$target_dataset") | ||||
| fi | ||||
| 
 | ||||
| if [[ "$?" == "0" ]] | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 mwiegand
						mwiegand