refactor: update skeleton and scripts
This commit is contained in:
parent
fad2dcf339
commit
07994c11c5
7 changed files with 18 additions and 24 deletions
17
skel/opt/scripts/restic/backup.sh
Normal file
17
skel/opt/scripts/restic/backup.sh
Normal 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
|
21
skel/opt/scripts/restic/forget.sh
Normal file
21
skel/opt/scripts/restic/forget.sh
Normal 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
|
15
skel/opt/scripts/restic/prune.sh
Normal file
15
skel/opt/scripts/restic/prune.sh
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue