mirror of
https://asciireactor.com/o4data/zfs-backup.git
synced 2024-11-27 23:05:07 +00:00
Cleaned up whitespace.
This commit is contained in:
parent
e090fcf21d
commit
88258df653
18
backup.sh
18
backup.sh
@ -55,7 +55,7 @@ run_snapshot()
|
|||||||
{
|
{
|
||||||
if [ $ZB_TEST_MODE = "TRUE" ]; then
|
if [ $ZB_TEST_MODE = "TRUE" ]; then
|
||||||
echo zfs snapshot $ZFS_SNAPSHOT_OPTS $dset@$snapid
|
echo zfs snapshot $ZFS_SNAPSHOT_OPTS $dset@$snapid
|
||||||
else
|
else
|
||||||
zfs snapshot $ZFS_SNAPSHOT_OPTS $dset@$snapid
|
zfs snapshot $ZFS_SNAPSHOT_OPTS $dset@$snapid
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ populate_datasets()
|
|||||||
snapshot_dataset="yes"
|
snapshot_dataset="yes"
|
||||||
send_dataset="yes"
|
send_dataset="yes"
|
||||||
for option in $dataset_options; do
|
for option in $dataset_options; do
|
||||||
case $option in
|
case $option in
|
||||||
"nosnap"* )
|
"nosnap"* )
|
||||||
snapshot_dataset=""
|
snapshot_dataset=""
|
||||||
;;
|
;;
|
||||||
@ -133,7 +133,7 @@ list_remote_datasets() {
|
|||||||
while read addr user port zroot speed; do
|
while read addr user port zroot speed; do
|
||||||
echo "=== $user@$addr $zroot ==="
|
echo "=== $user@$addr $zroot ==="
|
||||||
if [ $zroot ]; then
|
if [ $zroot ]; then
|
||||||
case $zroot in
|
case $zroot in
|
||||||
*"/") ;;
|
*"/") ;;
|
||||||
*) zroot="$zroot/" ;;
|
*) zroot="$zroot/" ;;
|
||||||
esac
|
esac
|
||||||
@ -156,7 +156,7 @@ get_latest_snapshot()
|
|||||||
get_latest_remote_snapshot()
|
get_latest_remote_snapshot()
|
||||||
{
|
{
|
||||||
if [ $zroot ]; then
|
if [ $zroot ]; then
|
||||||
case $zroot in
|
case $zroot in
|
||||||
*"/") ;;
|
*"/") ;;
|
||||||
*) zroot="$zroot/" ;;
|
*) zroot="$zroot/" ;;
|
||||||
esac
|
esac
|
||||||
@ -164,7 +164,6 @@ get_latest_remote_snapshot()
|
|||||||
list_cmd="zfs list -t snapshot $zroot$dset"
|
list_cmd="zfs list -t snapshot $zroot$dset"
|
||||||
remote_cmd="$list_cmd|tail -n1|cut -d'@' -f2|cut -d' ' -f 1"
|
remote_cmd="$list_cmd|tail -n1|cut -d'@' -f2|cut -d' ' -f 1"
|
||||||
run_remote
|
run_remote
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
zfs_allow_origin()
|
zfs_allow_origin()
|
||||||
@ -180,7 +179,7 @@ zfs_allow_mirrors()
|
|||||||
while read addr user port zroot speed; do
|
while read addr user port zroot speed; do
|
||||||
echo "=== $user@$addr $zroot ==="
|
echo "=== $user@$addr $zroot ==="
|
||||||
if [ $zroot ]; then
|
if [ $zroot ]; then
|
||||||
case $zroot in
|
case $zroot in
|
||||||
*"/") ;;
|
*"/") ;;
|
||||||
*) zroot="$zroot/" ;;
|
*) zroot="$zroot/" ;;
|
||||||
esac
|
esac
|
||||||
@ -209,7 +208,7 @@ send_latest()
|
|||||||
while read addr user port zroot speed; do
|
while read addr user port zroot speed; do
|
||||||
echo "=== $user@$addr $zroot ==="
|
echo "=== $user@$addr $zroot ==="
|
||||||
if [ $zroot ]; then
|
if [ $zroot ]; then
|
||||||
case $zroot in
|
case $zroot in
|
||||||
*"/") ;;
|
*"/") ;;
|
||||||
*) zroot="$zroot/" ;;
|
*) zroot="$zroot/" ;;
|
||||||
esac
|
esac
|
||||||
@ -232,7 +231,7 @@ send_increment()
|
|||||||
while read addr user port zroot speed; do
|
while read addr user port zroot speed; do
|
||||||
echo "=== $user@$addr $zroot ==="
|
echo "=== $user@$addr $zroot ==="
|
||||||
if [ $zroot ]; then
|
if [ $zroot ]; then
|
||||||
case $zroot in
|
case $zroot in
|
||||||
*"/") ;;
|
*"/") ;;
|
||||||
*) zroot="$zroot/" ;;
|
*) zroot="$zroot/" ;;
|
||||||
esac
|
esac
|
||||||
@ -253,12 +252,11 @@ send_increment()
|
|||||||
|
|
||||||
################################### MAIN ####################################
|
################################### MAIN ####################################
|
||||||
|
|
||||||
### Options
|
|
||||||
set -- `getopt "tvl:" "$@"` || {
|
set -- `getopt "tvl:" "$@"` || {
|
||||||
echo "Usage: `basename $0` [-tvl] [command]" 1>&2
|
echo "Usage: `basename $0` [-tvl] [command]" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
ZB_TEST_MODE=FALSE
|
|
||||||
while :; do
|
while :; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-t)
|
-t)
|
||||||
|
Loading…
Reference in New Issue
Block a user