Compare commits
3 commits
dacb7cfec3
...
1ea39b8117
Author | SHA1 | Date | |
---|---|---|---|
1ea39b8117 | |||
bd118be239 | |||
21f871b2f8 |
7 changed files with 28 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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" ]]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
from ipaddress import ip_interface
|
||||
from base64 import b64decode
|
||||
|
||||
defaults = {
|
||||
'ssh': {
|
||||
'multiplex_incoming': True,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'ssh/allow_users',
|
||||
|
|
|
@ -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" ]]
|
||||
|
|
|
@ -38,6 +38,10 @@
|
|||
# 'apm': 1,
|
||||
# },
|
||||
# },
|
||||
'ssh': {
|
||||
# multipling prevents server from sleeping
|
||||
'multiplex_incoming': False,
|
||||
},
|
||||
'wol-sleeper': {
|
||||
'network': 'internal',
|
||||
'waker': 'home.server',
|
||||
|
|
Loading…
Reference in a new issue