Save backups in a backup directory
This commit is contained in:
parent
6c82aa2047
commit
6f51151d64
2 changed files with 4 additions and 4 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -48,5 +48,4 @@ dist/
|
||||||
*.7z
|
*.7z
|
||||||
*.bak
|
*.bak
|
||||||
|
|
||||||
|
backend/backups
|
||||||
|
|
||||||
|
|
|
@ -54,9 +54,10 @@ db.sqlite3:
|
||||||
make migrate
|
make migrate
|
||||||
|
|
||||||
backup:
|
backup:
|
||||||
sqlite3 $(DB_FILE) .dump | gzip -9 > BACKUP_$(DB_FILE)_$(shell date +"%Y-%m-%d_%H:%M:%S").sql.gz
|
mkdir -p backups
|
||||||
|
sqlite3 $(DB_FILE) .dump | gzip -9 > ./backups/BACKUP_$(DB_FILE)_$(shell date +"%Y-%m-%d_%H:%M:%S").sql.gz
|
||||||
# Restore with:
|
# Restore with:
|
||||||
# gzip -cd BACKUP_$(DB_FILE)_*.sql.gz | sqlite3 $(DB_FILE)
|
# gzip -cd BACKUP_FILE.sql.gz | sqlite3 $(DB_FILE)
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
default: build
|
default: build
|
||||||
|
|
Loading…
Reference in a new issue