updates to make better use of restic-scripts
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -2,3 +2,6 @@
|
|||||||
path = docker-observation
|
path = docker-observation
|
||||||
url = https://gitea.john-stream.com/john/docker-observation.git
|
url = https://gitea.john-stream.com/john/docker-observation.git
|
||||||
branch = main
|
branch = main
|
||||||
|
[submodule "restic-scripts"]
|
||||||
|
path = restic-scripts
|
||||||
|
url = https://gitea.john-stream.com/john/restic-scripts
|
||||||
|
|||||||
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
json
|
||||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pydantic>=2,<3
|
||||||
1
restic-scripts
Submodule
1
restic-scripts
Submodule
Submodule restic-scripts added at 9127b34739
24
scripts/backup.sh
Executable file
24
scripts/backup.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z "$BACKUP_DIR" ]; then
|
||||||
|
echo "Error: BACKUP_DIR is not set."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$RESTIC_REPOSITORY" ]; then
|
||||||
|
echo "Error: RESTIC_REPOSITORY is not set."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$RESTIC_PASSWORD" ]; then
|
||||||
|
echo "Error: RESTIC_PASSWORD is not set."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
python -m restic.backup --project zigbee-stack --services mqtt,z2m "$@"
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(readlink -f $(dirname "${BASH_SOURCE[0]}"))
|
||||||
|
|
||||||
|
$SCRIPT_DIR/prune_backups.sh
|
||||||
10
scripts/prune_backups.sh
Executable file
10
scripts/prune_backups.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
python -m restic.forget \
|
||||||
|
--keep-last 5 \
|
||||||
|
--keep-weekly 8 \
|
||||||
|
--keep-monthly 12 \
|
||||||
|
--keep-yearly 7
|
||||||
|
# --json | jq .
|
||||||
|
|
||||||
|
python -m restic.prune
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SCRIPT_DIR=$(readlink -f $(dirname "${BASH_SOURCE[0]}"))
|
|
||||||
|
|
||||||
$SCRIPT_DIR/restic_command.sh forget --prune \
|
|
||||||
--keep-last 5 \
|
|
||||||
--keep-weekly 8 \
|
|
||||||
--keep-monthly 12 \
|
|
||||||
--keep-yearly 7
|
|
||||||
Reference in New Issue
Block a user