From 70d135211cb271f6bea7021de8836c38a67b7db5 Mon Sep 17 00:00:00 2001 From: Ilya Mukhortov Date: Sat, 20 Jan 2024 13:02:54 +1000 Subject: [PATCH] pass --- cron-tasks/backup_database_medicine.sh | 5 +++-- cron-tasks/backup_database_medicine_remd.sh | 5 +++-- cron-tasks/crontab.txt | 4 ++-- medicine-remd/crontab.txt | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cron-tasks/backup_database_medicine.sh b/cron-tasks/backup_database_medicine.sh index 6aab84d..fa8af2e 100755 --- a/cron-tasks/backup_database_medicine.sh +++ b/cron-tasks/backup_database_medicine.sh @@ -5,9 +5,10 @@ export LC_ALL=C cd /root/medicine-backups/ +weekday_number=$(date +%u) weekday=$(date +%A | tr '[:upper:]' '[:lower:]') -backup_filename="medicine_${weekday}.sql" -archive_filename="medicine_${weekday}.tar.gz" +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_* diff --git a/cron-tasks/backup_database_medicine_remd.sh b/cron-tasks/backup_database_medicine_remd.sh index 95f4551..329ff68 100755 --- a/cron-tasks/backup_database_medicine_remd.sh +++ b/cron-tasks/backup_database_medicine_remd.sh @@ -5,9 +5,10 @@ export LC_ALL=C cd /root/medicine-backups/ +weekday_number=$(date +%u) weekday=$(date +%A | tr '[:upper:]' '[:lower:]') -backup_filename="medicine_remd_${weekday}.sql" -archive_filename="medicine_remd_${weekday}.tar.gz" +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 diff --git a/cron-tasks/crontab.txt b/cron-tasks/crontab.txt index e0c6139..1159ff7 100755 --- a/cron-tasks/crontab.txt +++ b/cron-tasks/crontab.txt @@ -1,2 +1,2 @@ -59 23 * * * /root/medicine-config/cron-tasks/backup_database_medicine.sh -55 23 * * * /root/medicine-config/cron-tasks/backup_database_medicine_remd.sh +55 13 * * * /root/medicine-config/cron-tasks/backup_database_medicine.sh +50 13 * * * /root/medicine-config/cron-tasks/backup_database_medicine_remd.sh \ No newline at end of file diff --git a/medicine-remd/crontab.txt b/medicine-remd/crontab.txt index a5df97e..d0544ff 100755 --- a/medicine-remd/crontab.txt +++ b/medicine-remd/crontab.txt @@ -1 +1 @@ -30 23 * * * /root/medicine-config/medicine-remd/update.sh +30 13 * * * /root/medicine-config/medicine-remd/update.sh