iankelling.org
/
git
/
distro-setup
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f5fe5af
)
btrbk fixes
author
Ian Kelling
<ian@iankelling.org>
Wed, 5 Jul 2023 00:12:19 +0000
(20:12 -0400)
committer
Ian Kelling
<ian@iankelling.org>
Wed, 5 Jul 2023 00:12:19 +0000
(20:12 -0400)
btrbk-run
patch
|
blob
|
history
diff --git
a/btrbk-run
b/btrbk-run
index 5388858b946c44640ed18fa25285acfbdcb296ac..057ff79b6ed052617209726ef39c293a3743bccc 100644
(file)
--- a/
btrbk-run
+++ b/
btrbk-run
@@
-65,6
+65,7
@@
conf_only=false
dry_run=false # mostly for testing
rate_limit=no
verbose=true; verbose_arg=-v
dry_run=false # mostly for testing
rate_limit=no
verbose=true; verbose_arg=-v
+force=false
if [[ $INVOCATION_ID ]]; then
# INVOCATION_ID means running as a systemd service. we cant show progress in this case,
# but if we pass the arg, it will insert mbuffer into the command.
if [[ $INVOCATION_ID ]]; then
# INVOCATION_ID means running as a systemd service. we cant show progress in this case,
# but if we pass the arg, it will insert mbuffer into the command.
@@
-91,7
+92,7
@@
cron=false
fast=false
kd_spread_maybe=false
orig_args=("$@")
fast=false
kd_spread_maybe=false
orig_args=("$@")
-temp=$(getopt -l cron,fast,pull-reexec,help 23ceikl:m:npqrs:t:vh "$@") || usage 1
+temp=$(getopt -l cron,fast,pull-reexec,help 23ce
f
ikl:m:npqrs:t:vh "$@") || usage 1
eval set -- "$temp"
while true; do
case $1 in
eval set -- "$temp"
while true; do
case $1 in
@@
-110,6
+111,7
@@
while true; do
-c) conf_only=true ;;
# quit early, just btrbk, no extra remounting etc.
-e) early=true ;;
-c) conf_only=true ;;
# quit early, just btrbk, no extra remounting etc.
-e) early=true ;;
+ -f) force=true ;;
# skip various checks. when we run twice in a row for
# switch mail-host, no need to repeat the same checks again.
--fast) fast=true ;;
# skip various checks. when we run twice in a row for
# switch mail-host, no need to repeat the same checks again.
--fast) fast=true ;;
@@
-214,6
+216,9
@@
fi
kd_spread=false
kd_spread=false
+if ! $cron && $kd_spread_maybe; then
+ kd_spread=true
+fi
# set default targets
if [[ ! -v targets && ! $source ]]; then
if $cron; then
# set default targets
if [[ ! -v targets && ! $source ]]; then
if $cron; then
@@
-517,7
+522,7
@@
else
# which is good enough.
#
# This is a separate ssh because the command can fail and thatis ok.
# which is good enough.
#
# This is a separate ssh because the command can fail and thatis ok.
- if $cron; then
+ if $cron
&& ! $force
; then
locked=false
if lock_info=$(timeout -s 9 6 ssh $h DISPLAY=:0 xscreensaver-command -time); then
if [[ $lock_info != *non-blanked* ]]; then
locked=false
if lock_info=$(timeout -s 9 6 ssh $h DISPLAY=:0 xscreensaver-command -time); then
if [[ $lock_info != *non-blanked* ]]; then
@@
-718,12
+723,12
@@
fi
if [[ $ret == 0 ]]; then
for tg in ${targets[@]}; do
if [[ $ret == 0 ]]; then
for tg in ${targets[@]}; do
- h=$(ssh
root@
$tg hostname)
- rsync -a
/var/log/btrbk
$tg:/var/log/btrbk/$tg
+ h=$(ssh $tg hostname)
+ rsync -a
-f"- */" -f"+ *" /var/log/btrbk/ root@
$tg:/var/log/btrbk/$tg
ssh root@$tg /usr/local/bin/mail-backup-clean
done
if [[ $source ]]; then
ssh root@$tg /usr/local/bin/mail-backup-clean
done
if [[ $source ]]; then
- rsync -a
$source:/var/log/btrbk
/var/log/btrbk/$source
+ rsync -a
-f"- */" -f"+ *" $source:/var/log/btrbk/
/var/log/btrbk/$source
fi
fi
fi
fi