mirror of
https://asciireactor.com/o4data/zfs-backup.git
synced 2024-11-24 17:05:06 +00:00
Added debug function.
This commit is contained in:
parent
f4f86d7783
commit
b5013414cb
14
backup.sh
14
backup.sh
@ -41,6 +41,7 @@ while read dataset dataset_options; do
|
||||
snapshot_dataset="yes"
|
||||
send_dataset="yes"
|
||||
for option in $dataset_options; do
|
||||
debug "Processing option $option."
|
||||
case $option in
|
||||
"nosnap"* ) snapshot_dataset="" ;;
|
||||
"nosend"* ) send_dataset="" ;;
|
||||
@ -57,6 +58,13 @@ while read dataset dataset_options; do
|
||||
fi
|
||||
done < datasets.txt
|
||||
|
||||
debug()
|
||||
{
|
||||
if [ $BG_DEBUG_MODE = "TRUE" ]; do
|
||||
echo $@
|
||||
fi
|
||||
}
|
||||
|
||||
list_datasets()
|
||||
{
|
||||
for dataset in $SEND_DATASETS; do
|
||||
@ -171,10 +179,8 @@ send_latest()
|
||||
for dataset in $SEND_DATASETS; do
|
||||
dataset=`echo $dataset|cut -d':' -f1`
|
||||
remote_dataset=`echo $dataset|cut -d':' -f2`
|
||||
if [ $BG_DEBUG_MODE = "TRUE" ]; then
|
||||
echo dataset: $dataset
|
||||
echo remote dataset: $remote_dataset
|
||||
fi
|
||||
debug "dataset: $dataset"
|
||||
debug "remote dataset: $remote_dataset"
|
||||
origin_snapshot=`get_latest_snapshot $dataset`
|
||||
if [ $BG_TEST_MODE = "TRUE" ]; then
|
||||
echo zfs send $ZFS_SEND_OPTS $dataset@$origin_snapshot \| \
|
||||
|
Loading…
Reference in New Issue
Block a user