refactor: update skeleton and scripts

This commit is contained in:
Strix 2023-10-18 20:58:24 +02:00
parent fad2dcf339
commit 07994c11c5
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
7 changed files with 18 additions and 24 deletions

View file

@ -0,0 +1,17 @@
#!/bin/sh
ntfy() {
sh /opt/scripts/ntfy.sh -s "/neb/secrets/ntfy/ixvd-backups" -u "https://push.ixvd.net/ixvd-backups" "$@"
}
ntfy -m "performing backup..."
if restic \
-r "sftp://ixvd_backup_storage//$(hostname)" \
-p "/neb/secrets/restic/$(hostname).secret" \
backup \
--tag auto \
/srv /home /etc; then
ntfy -m "backup succeeded"
else
ntfy -m "backup failed" -e "warning,skull"
fi

View file

@ -0,0 +1,21 @@
#!/bin/sh
ntfy() {
sh /opt/scripts/ntfy.sh -s "/neb/secrets/ntfy/ixvd-backups" -u "https://push.ixvd.net/ixvd-backups" "$@"
}
ntfy -m "forgetting old backups..."
if restic \
-r "sftp://ixvd_backup_storage//$(hostname)" \
-p "/etc/ixvd/secrets/restic/$(hostname).secret" \
forget \
--keep-last 10 \
--keep-tag keep \
--keep-daily 20 \
--keep-weekly 20 \
--keep-monthly 6 \
--keep-yearly 10; then
ntfy -m "forget succeeded"
else
ntfy -m "forget failed" -e "warning,skull"
fi

View file

@ -0,0 +1,15 @@
#!/bin/sh
ntfy() {
sh /opt/scripts/ntfy.sh -s "/neb/secrets/ntfy/ixvd-backups" -u "https://push.ixvd.net/ixvd-backups" "$@"
}
ntfy -m "pruning old backups..."
if restic \
-r "sftp://ixvd_backup_storage//$(hostname)" \
-p "/etc/ixvd/secrets/restic/$(hostname).secret" \
prune; then
notify -m "pruning succeeded"
else
notify -m "prune failed" -e "warning,skull"
fi