„bashclub-zsync/usr/bin/bashclub-zsync“ ändern

This commit is contained in:
thorsten.spille 2023-02-18 11:27:41 +01:00
parent 667fb123a5
commit 8da28b51a5

View File

@ -53,6 +53,7 @@ shift $((OPTIND-1))
# load config file # load config file
if [ -f $conf ]; then if [ -f $conf ]; then
echo "Reading configuration $conf"
source $conf source $conf
else else
mkdir -p $(dirname $conf) mkdir -p $(dirname $conf)
@ -67,6 +68,14 @@ EOF
usage 0 usage 0
fi fi
if [[ $source == "" ]]; then
echo "source is empty, switching to local mode."
ssh=
echo -e "Configuration:\n\ttarget=$target\n\ttag=$tag\n\tsubvol_source=$subvol_source\n\tsnapshot_filter=$snapshot_filter\n"
else
echo -e "Configuration:\n\ttarget=$target\n\tsource=$source\n\ttag=$tag\n\tsubvol_source=$subvol_source\n\tsnapshot_filter=$snapshot_filter\n"
fi
# query source datasets/subvols to replicate # query source datasets/subvols to replicate
IFS=$'\n' IFS=$'\n'
for zvol in $($ssh $source "zfs get -H -o name,value,source -t filesystem,volume $tag"); do for zvol in $($ssh $source "zfs get -H -o name,value,source -t filesystem,volume $tag"); do