1
0

add timetracker backup/restore scripts

This commit is contained in:
2026-01-16 11:49:16 +01:00
parent 18d3fdd67f
commit eb8771cb5d
3 changed files with 15 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/bash
NOW=$(date +"%d-%m-%Y-%H-%M")
BACKUPDIR="/home/timetracker/app/games/fixtures/backups"
set -euxo pipefail
docker compose exec timetracker poetry run python manage.py dumpdata games.game games.edition games.purchase games.device games.platform --output ${BACKUPDIR}/${NOW}.json
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/bash
NOW=$(date +"%d-%m-%Y-%H-%M")
BACKUPDIR="/home/timetracker/app/games/fixtures/backups"
set -euxo pipefail
docker compose exec timetracker poetry run python manage.py dumpdata games.Session --output ${BACKUPDIR}/${NOW}.json
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/bash
BACKUPDIR="backups"
[ -z "${1:-}" ] && echo "No file specified, exitting." && exit 1
set -euxo pipefail
docker compose exec timetracker poetry run python manage.py loaddata ${BACKUPDIR}/${1}