reorganize

This commit is contained in:
Pim Kunis 2023-04-26 17:45:19 +02:00
parent de9c0019fa
commit c2521842a0
15 changed files with 90 additions and 94 deletions

View file

@ -0,0 +1,6 @@
[Unit]
Description=Backup data using Borgmatic
[Service]
ExecStart=/usr/bin/borgmatic --config /root/backup.yml
Type=oneshot

View file

@ -0,0 +1,10 @@
[Unit]
Description=Backup data daily
[Timer]
OnCalendar=*-*-* 3:00:00
Persistent=true
RandomizedDelaySec=1h
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,16 @@
location:
source_directories:
- /data
repositories:
- 'ssh://root@lewis.hyp/mnt/kingston1TB/hosts/atlas'
retention:
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
storage:
unknown_unencrypted_repo_access_is_ok: true
hooks:
before_everything:
- /root/stop_vms.sh
after_everything:
- /root/start_vms.sh

View file

@ -0,0 +1,3 @@
#!/bin/bash
for i in $(virsh list --all --name --autostart); do virsh start "$i"; done

View file

@ -0,0 +1,9 @@
#!/bin/bash
for i in $(virsh list --state-running --name --autostart); do
virsh shutdown "$i"
echo Stopping domain "$i"
until virsh domstate "$i" | grep shut; do
sleep 0.5
done
done