mirror of
https://asciireactor.com/o4data/zfs-backup.git
synced 2024-11-21 17:05:05 +00:00
Fixed missing quotes.
This commit is contained in:
parent
2573fb8847
commit
e3a1897e9c
34
backup.sh
34
backup.sh
@ -45,7 +45,7 @@ run_send_recv()
|
||||
{
|
||||
ssh_cmd="ssh $SSH_SEND_OPTS -o port=$port $user@$addr"
|
||||
pv_cmd="pv -qL ${speed:-$DEFAULT_SPEED}"
|
||||
if [ $ZB_TEST_MODE = "TRUE" ]; then
|
||||
if ["$ZB_TEST_MODE" = "TRUE" ]; then
|
||||
echo "$send_cmd | $pv_cmd | $ssh_cmd $recv_cmd"
|
||||
else
|
||||
$send_cmd | $pv_cmd | $ssh_cmd $recv_cmd
|
||||
@ -54,7 +54,7 @@ run_send_recv()
|
||||
|
||||
run_snapshot()
|
||||
{
|
||||
if [ $ZB_TEST_MODE = "TRUE" ]; then
|
||||
if [ "$ZB_TEST_MODE" = "TRUE" ]; then
|
||||
echo zfs snapshot $ZFS_SNAPSHOT_OPTS $dset@$snapid
|
||||
else
|
||||
zfs snapshot $ZFS_SNAPSHOT_OPTS $dset@$snapid
|
||||
@ -63,7 +63,7 @@ run_snapshot()
|
||||
|
||||
run_allow()
|
||||
{
|
||||
if [ $ZB_TEST_MODE = "TRUE" ]; then
|
||||
if [ "$ZB_TEST_MODE" = "TRUE" ]; then
|
||||
echo zfs allow -u $LOCAL_USER $ORIGIN_PERMS $dset
|
||||
else
|
||||
zfs allow -u $LOCAL_USER $ORIGIN_PERMS $dset
|
||||
@ -73,7 +73,7 @@ run_allow()
|
||||
run_remote()
|
||||
{
|
||||
ssh_cmd="ssh $SSH_SEND_OPTS -o port=$port $user@$addr"
|
||||
if [ $ZB_TEST_MODE = "TRUE" ]; then
|
||||
if [ "$ZB_TEST_MODE" = "TRUE" ]; then
|
||||
echo "\`$ssh_cmd $remote_cmd\`"
|
||||
else
|
||||
$ssh_cmd $remote_cmd
|
||||
@ -81,7 +81,7 @@ run_remote()
|
||||
}
|
||||
|
||||
set_compression() {
|
||||
case $SEND_COMPRESSED in
|
||||
case "$SEND_COMPRESSED" in
|
||||
[tTyY]*) ZFS_SEND_OPTS="$ZFS_SEND_OPTS -c"
|
||||
debug "Enabled send as compressed datasets." ;;
|
||||
esac
|
||||
@ -90,14 +90,14 @@ set_compression() {
|
||||
populate_datasets()
|
||||
{
|
||||
while read dset dataset_options; do
|
||||
case $dset in
|
||||
case "$dset" in
|
||||
\#*) continue;;
|
||||
esac
|
||||
|
||||
snapshot_dataset="yes"
|
||||
send_dataset="yes"
|
||||
for option in $dataset_options; do
|
||||
case $option in
|
||||
case "$option" in
|
||||
"nosnap"* )
|
||||
snapshot_dataset=""
|
||||
;;
|
||||
@ -133,8 +133,8 @@ list_datasets()
|
||||
list_remote_datasets() {
|
||||
while read addr user port zroot speed; do
|
||||
echo "=== $user@$addr $zroot ==="
|
||||
if [ $zroot ]; then
|
||||
case $zroot in
|
||||
if [ "$zroot" ]; then
|
||||
case "$zroot" in
|
||||
*"/") ;;
|
||||
*) zroot="$zroot/" ;;
|
||||
esac
|
||||
@ -157,7 +157,7 @@ get_latest_snapshot()
|
||||
get_latest_remote_snapshot()
|
||||
{
|
||||
if [ $zroot ]; then
|
||||
case $zroot in
|
||||
case "$zroot" in
|
||||
*"/") ;;
|
||||
*) zroot="$zroot/" ;;
|
||||
esac
|
||||
@ -179,8 +179,8 @@ zfs_allow_mirrors()
|
||||
{
|
||||
while read addr user port zroot speed; do
|
||||
echo "=== $user@$addr $zroot ==="
|
||||
if [ $zroot ]; then
|
||||
case $zroot in
|
||||
if [ "$zroot" ]; then
|
||||
case "$zroot" in
|
||||
*"/") ;;
|
||||
*) zroot="$zroot/" ;;
|
||||
esac
|
||||
@ -200,7 +200,7 @@ create_snapshots()
|
||||
snapid="`date -I`-`date +%s`-$LOCAL_TZ"
|
||||
for dset in $SNAPSHOT_DATASETS; do
|
||||
run_snapshot
|
||||
debug Created snapshot $dset@$snapid.
|
||||
debug "Created snapshot $dset@$snapid."
|
||||
done
|
||||
}
|
||||
|
||||
@ -208,8 +208,8 @@ send_latest()
|
||||
{
|
||||
while read addr user port zroot speed; do
|
||||
echo "=== $user@$addr $zroot ==="
|
||||
if [ $zroot ]; then
|
||||
case $zroot in
|
||||
if [ "$zroot" ]; then
|
||||
case "$zroot" in
|
||||
*"/") ;;
|
||||
*) zroot="$zroot/" ;;
|
||||
esac
|
||||
@ -230,8 +230,8 @@ send_increment()
|
||||
{
|
||||
while read addr user port zroot speed; do
|
||||
echo "=== $user@$addr $zroot ==="
|
||||
if [ $zroot ]; then
|
||||
case $zroot in
|
||||
if [ "$zroot" ]; then
|
||||
case "$zroot" in
|
||||
*"/") ;;
|
||||
*) zroot="$zroot/" ;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user