Compare commits

...

2 commits

Author SHA1 Message Date
mwiegand
72561bdb52 backup openhab 2021-11-12 16:59:57 +01:00
mwiegand
b5489cd22f bw 4.13.1 2021-11-12 16:47:01 +01:00
5 changed files with 23 additions and 7 deletions

View file

@ -40,9 +40,16 @@ def zfs(metadata):
'readonly': 'off',
'backup': False,
}
# for zfs send/recv
if other_node.has_bundle('zfs'):
# base datasets for each tank
for pool in other_node.metadata.get('zfs/pools'):
datasets[f"tank/{other_node.metadata.get('id')}/{pool}"] = {
'mountpoint': None,
'readonly': 'on',
'backup': False,
}
# actual datasets
for path in other_node.metadata.get('backup/paths'):
for dataset, config in other_node.metadata.get('zfs/datasets').items():
if path == config.get('mountpoint'):

View file

@ -45,7 +45,7 @@ fi
if [[ "$?" == "0" ]]
then
zfs bookmark "$source_dataset@$new_bookmark" "$source_dataset#$new_bookmark"
zfs destroy "$source_dataset@$new_bookmark"
#zfs destroy "$source_dataset@$new_bookmark" # keep snapshots?
echo "SUCCESS"
else
zfs destroy "$source_dataset@$new_bookmark"

View file

@ -1,8 +1,16 @@
defaults = {
'apt': {
'packages': {
'jq': {},
'rsync': {},
'jq': {
'needed_by': {
'svc_systemd:backup.timer',
},
},
'rsync': {
'needed_by': {
'svc_systemd:backup.timer',
},
},
},
},
'backup': {

View file

@ -1,9 +1,10 @@
{
'hostname': '10.0.0.17',
'groups': [
'raspberry-pi',
'backup',
'debian-11',
'monitored',
'raspberry-pi',
'webserver',
],
'bundles': [
@ -39,7 +40,7 @@
'pools': {
'tank': {
'devices': [
'/dev/sda',
'/dev/mmcblk1p3',
],
},
},

View file

@ -1,4 +1,4 @@
bundlewrap>=4.13.0
bundlewrap>=4.13.1
pycryptodome
PyNaCl
PyYAML