From 43711babe9e68d4d6cff2b5f2a9047c9f5154738 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Thu, 24 Jun 2021 10:46:55 +0200 Subject: [PATCH] Create make-a-backup.sh --- make-a-backup.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 make-a-backup.sh diff --git a/make-a-backup.sh b/make-a-backup.sh new file mode 100644 index 0000000..f944155 --- /dev/null +++ b/make-a-backup.sh @@ -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