Backup target for makefile

This commit is contained in:
Imbus 2024-02-27 07:43:20 +01:00
parent 6e48c0a088
commit 6c82aa2047

View file

@ -53,5 +53,10 @@ migrate:
db.sqlite3:
make migrate
backup:
sqlite3 $(DB_FILE) .dump | gzip -9 > BACKUP_$(DB_FILE)_$(shell date +"%Y-%m-%d_%H:%M:%S").sql.gz
# Restore with:
# gzip -cd BACKUP_$(DB_FILE)_*.sql.gz | sqlite3 $(DB_FILE)
# Default target
default: build