preserve_recordsize
This commit is contained in:
parent
5838eedf1e
commit
89b9214ce4
1 changed files with 3 additions and 2 deletions
|
@ -52,14 +52,15 @@ backup_snap=$(echo "$backups_server_zfs_snapshots" | grep "$backup_server_datase
|
|||
backup_snaps=$(echo "$backups_server_zfs_snapshots" | grep "$backup_server_dataset"/"$dataset_clean"@ | grep -E "....-..-.._........--"$zfsnap_days_keep_snaps"d" | cut -d"@" -f2 | cut -d" " -f1)
|
||||
source_backups_server_match=$(grep -Fxf <(echo "$source_snaps") <(echo "$backup_snaps"))
|
||||
source_backups_server_match_tailed=$(echo "$source_backups_server_match" | tail -n1)
|
||||
dataset_recordsize=$(zfs get recordsize -H -o value "$dataset")
|
||||
|
||||
if [ -z "$backup_snap" ]
|
||||
then
|
||||
echo "Snapshot on backup server not found, sending "$dataset"@"$source_snap" to server "$backup_server" "$backup_server_dataset"/"$dataset_clean""
|
||||
zfs send "$dataset"@"$source_snap" | pv -L "$shape_megabytes"m | ssh -$backup_server_ipv "$backup_server" -p "$backup_server_port" zfs recv "$backup_server_dataset"/"$dataset_clean" && echo "Send OK"
|
||||
zfs send "$dataset"@"$source_snap" | pv -L "$shape_megabytes"m | ssh -$backup_server_ipv "$backup_server" -p "$backup_server_port" zfs recv -o recordsize="$dataset_recordsize" "$backup_server_dataset"/"$dataset_clean" && echo "Send OK"
|
||||
else
|
||||
echo "Snapshot on backup server found, sending incremental from "$dataset"@"$source_backups_server_match_tailed" to "$dataset"@"$source_snap" to server "$backup_server" "$backup_server_dataset"/"$dataset_clean""
|
||||
zfs send -I "$dataset"@"$source_backups_server_match_tailed" "$dataset"@"$source_snap" | pv -L "$shape_megabytes"m | ssh -$backup_server_ipv "$backup_server" -p "$backup_server_port" zfs recv "$backup_server_dataset"/"$dataset_clean" -F && echo "Send OK"
|
||||
zfs send -I "$dataset"@"$source_backups_server_match_tailed" "$dataset"@"$source_snap" | pv -L "$shape_megabytes"m | ssh -$backup_server_ipv "$backup_server" -p "$backup_server_port" zfs recv -o recordsize="$dataset_recordsize" "$backup_server_dataset"/"$dataset_clean" -F && echo "Send OK"
|
||||
fi
|
||||
done
|
||||
del_snaps_block
|
||||
|
|
Loading…
Reference in a new issue