1
0
Fork 0
This commit is contained in:
Ilya Mukhortov 2024-05-28 18:43:20 +10:00
parent c13bf0db35
commit fa457f4a9a
3 changed files with 1 additions and 38 deletions

View File

@ -46,6 +46,7 @@
### Crontab tasks
00 13 * * * /root/medicine-config/update_repository.sh
30 13 * * * /root/medicine-config/medicine-remd/update.sh
50 13 * * * /root/medicine-config/medicine-remd/backup_database.sh
20 13 * * * /root/medicine-config/medicine/update.sh

View File

@ -1,20 +0,0 @@
#!/bin/sh
set -e
export LC_ALL=C
cd /root/medicine-backups/
weekday_number=$(date +%u)
weekday=$(date +%A | tr '[:upper:]' '[:lower:]')
backup_filename="medicine_${weekday_number}_${weekday}.sql"
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}" \
--exclude-table-data=riisz_logging \
--exclude-table-data=reversion_*
if test -f "${archive_filename}"; then
rm "${archive_filename}"
fi
tar -czf "${archive_filename}" "${backup_filename}"
rm "${backup_filename}"

View File

@ -1,18 +0,0 @@
#!/bin/sh
set -e
export LC_ALL=C
cd /root/medicine-backups/
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}"
if test -f "${archive_filename}"; then
rm "${archive_filename}"
fi
tar -czf "${archive_filename}" "${backup_filename}"
rm "${backup_filename}"