3
0
Fork 0

fix backup

This commit is contained in:
Ilya Mukhortov 2026-08-16 20:40:24 +10:00
parent 42051511c9
commit f7ef395bdd
1 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,11 @@ weekday_number=$(date +%u)
weekday=$(date +%A | tr '[:upper:]' '[:lower:]')
backup_filename="medicine_remd_${weekday_number}_${weekday}.sql"
archive_filename="medicine_remd_${weekday_number}_${weekday}.tar.gz"
docker exec -i medicine-stack-postgres pg_dump --no-owner -U postgres -F p medicine_remd > "${backup_filename}"
docker exec -i medicine-stack-postgres pg_dump --no-owner -U postgres -F p medicine_remd > "${backup_filename}" \
--exclude-table-data=django_session \
--exclude-table-data=django_admin_log \
--exclude-table-data=django_celery_* \
--exclude-table-data=history_historylog
if test -f "${archive_filename}"; then
rm "${archive_filename}"