Compare commits

...

3 commits

Author SHA1 Message Date
1ea39b8117
dont multiplex to sleepers 2022-09-21 22:10:47 +02:00
bd118be239
readme 2022-09-21 22:10:14 +02:00
21f871b2f8
actually recompress data 2022-09-21 22:10:07 +02:00
7 changed files with 28 additions and 7 deletions

View file

@ -15,7 +15,7 @@ Raspberry pi as soundcard
# install bw fork
pip3 install --editable git+file:///Users/mwiegand/Projekte/bundlewrap-fork#egg=bundlewrap
pip3 install --editable git+file:///Users/mwiegand/Projekte/bundlewrap-fork@main#egg=bundlewrap
# monitor timers

View file

@ -39,7 +39,7 @@ else
echo "INCREMENTAL BACKUP"
last_bookmark=$(zfs list -t bookmark -H -o name | grep "^$source_dataset#$bookmark_prefix" | sort | tail -1 | cut -d '#' -f 2)
[[ -z "$last_bookmark" ]] && echo "ERROR - last_bookmark is empty" && exit 98
$(zfs send -v -L -c -i "#$last_bookmark" "$source_dataset@$new_bookmark" | $ssh sudo zfs recv "$target_dataset")
$(zfs send -v -L -i "#$last_bookmark" "$source_dataset@$new_bookmark" | $ssh sudo zfs recv "$target_dataset")
fi
if [[ "$?" == "0" ]]

View file

@ -4,7 +4,8 @@ Host *
GSSAPIAuthentication yes
StrictHostKeyChecking yes
GlobalKnownHostsFile /etc/ssh/ssh_known_hosts
# fixme: prevents backup server from sleeping
# ControlMaster auto
# ControlPath ~/.ssh/multiplex-%C
# ControlPersist 5m
Host ${' '.join(sorted(multiplex_hosts))}
ControlMaster auto
ControlPath ~/.ssh/multiplex-%C
ControlPersist 5m

View file

@ -1,3 +1,6 @@
from ipaddress import ip_interface
# on debian bullseye raspberry images, starting the systemd ssh
# daemon seems to collide with an existing sysv daemon
dont_touch_sshd = node.metadata.get('FIXME_dont_touch_sshd', False)
@ -24,6 +27,13 @@ files = {
'/etc/ssh/ssh_config': {
'content_type': 'mako',
'context': {
'multiplex_hosts': set(
str(ip_interface(other_node.metadata.get('network/internal/ipv4')).ip)
for other_node in repo.nodes
if other_node.has_bundle('ssh')
and other_node.metadata.get('network/internal/ipv4', None)
and other_node.metadata.get('ssh/multiplex_incoming')
),
},
'triggers': [
'svc_systemd:ssh:restart'

View file

@ -1,6 +1,12 @@
from ipaddress import ip_interface
from base64 import b64decode
defaults = {
'ssh': {
'multiplex_incoming': True,
},
}
@metadata_reactor.provides(
'ssh/allow_users',

View file

@ -27,7 +27,7 @@ do
echo "INCREMENTAL BACKUP"
last_bookmark=$(zfs list -t bookmark -H -o name | grep "^$dataset#$bookmark_prefix" | sort | tail -1 | cut -d '#' -f 2)
[[ -z "$last_bookmark" ]] && echo "ERROR - last_bookmark is empty" && exit 98
$(zfs send -v -c -L -i "#$last_bookmark" "$dataset@$new_bookmark" | $ssh sudo zfs recv "$dataset" -o mountpoint=none)
$(zfs send -v -L -i "#$last_bookmark" "$dataset@$new_bookmark" | $ssh sudo zfs recv "$dataset" -o mountpoint=none)
fi
if [[ "$?" == "0" ]]

View file

@ -38,6 +38,10 @@
# 'apm': 1,
# },
# },
'ssh': {
# multipling prevents server from sleeping
'multiplex_incoming': False,
},
'wol-sleeper': {
'network': 'internal',
'waker': 'home.server',