1
0
Fork 0
This commit is contained in:
Ilya Mukhortov 2024-01-20 13:02:54 +10:00
parent c42cd971c9
commit 70d135211c
4 changed files with 9 additions and 7 deletions

View File

@ -5,9 +5,10 @@ export LC_ALL=C
cd /root/medicine-backups/ cd /root/medicine-backups/
weekday_number=$(date +%u)
weekday=$(date +%A | tr '[:upper:]' '[:lower:]') weekday=$(date +%A | tr '[:upper:]' '[:lower:]')
backup_filename="medicine_${weekday}.sql" backup_filename="medicine_${weekday_number}_${weekday}.sql"
archive_filename="medicine_${weekday}.tar.gz" archive_filename="medicine_${weekday_number}_${weekday}.tar.gz"
docker exec -i medicine-stack-postgres pg_dump --no-owner -U postgres -F p medicine > "${backup_filename}" \ docker exec -i medicine-stack-postgres pg_dump --no-owner -U postgres -F p medicine > "${backup_filename}" \
--exclude-table-data=riisz_logging \ --exclude-table-data=riisz_logging \
--exclude-table-data=reversion_* --exclude-table-data=reversion_*

View File

@ -5,9 +5,10 @@ export LC_ALL=C
cd /root/medicine-backups/ cd /root/medicine-backups/
weekday_number=$(date +%u)
weekday=$(date +%A | tr '[:upper:]' '[:lower:]') weekday=$(date +%A | tr '[:upper:]' '[:lower:]')
backup_filename="medicine_remd_${weekday}.sql" backup_filename="medicine_remd_${weekday_number}_${weekday}.sql"
archive_filename="medicine_remd_${weekday}.tar.gz" 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}"
if test -f "${archive_filename}"; then if test -f "${archive_filename}"; then

View File

@ -1,2 +1,2 @@
59 23 * * * /root/medicine-config/cron-tasks/backup_database_medicine.sh 55 13 * * * /root/medicine-config/cron-tasks/backup_database_medicine.sh
55 23 * * * /root/medicine-config/cron-tasks/backup_database_medicine_remd.sh 50 13 * * * /root/medicine-config/cron-tasks/backup_database_medicine_remd.sh

View File

@ -1 +1 @@
30 23 * * * /root/medicine-config/medicine-remd/update.sh 30 13 * * * /root/medicine-config/medicine-remd/update.sh