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
|
||||
*.bak
|
||||
|
||||
|
||||
|
||||
backend/backups
|
||||
|
|
|
@ -54,9 +54,10 @@ db.sqlite3:
|
|||
make migrate
|
||||
|
||||
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:
|
||||
# gzip -cd BACKUP_$(DB_FILE)_*.sql.gz | sqlite3 $(DB_FILE)
|
||||
# gzip -cd BACKUP_FILE.sql.gz | sqlite3 $(DB_FILE)
|
||||
|
||||
# Default target
|
||||
default: build
|
||||
|
|
Loading…
Reference in a new issue