Create make-a-backup.sh

This commit is contained in:
Andros Fenollosa 2021-06-24 10:46:55 +02:00 committed by GitHub
parent 98223a1c4d
commit 43711babe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
make-a-backup.sh Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e
cd /home/django/project
docker exec -it django_1 python3 manage.py dumpdata --all --indent 4 --natural-primary --natural-foreign > /home/django/backups/dumpdata_$(date +"%Y-%m-%d").json
find /home/django/backups/* -mtime +30 -delete