1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
Ilya Mukhortov fa457f4a9a pass 2024-05-28 18:43:20 +10:00
Ilya Mukhortov c13bf0db35 pass 2024-05-28 18:26:35 +10:00
4 changed files with 19 additions and 38 deletions

View File

@ -46,7 +46,22 @@
### Crontab tasks ### Crontab tasks
00 13 * * * /root/medicine-config/update_repository.sh
30 13 * * * /root/medicine-config/medicine-remd/update.sh 30 13 * * * /root/medicine-config/medicine-remd/update.sh
50 13 * * * /root/medicine-config/medicine-remd/backup_database.sh 50 13 * * * /root/medicine-config/medicine-remd/backup_database.sh
20 13 * * * /root/medicine-config/medicine/update.sh 20 13 * * * /root/medicine-config/medicine/update.sh
55 13 * * * /root/medicine-config/medicine/backup_database.sh 55 13 * * * /root/medicine-config/medicine/backup_database.sh
# /etc/hosts
89.223.70.16 docker.med-logic.ru git.med-logic.ru sync.med-logic.ru sentry.med-logic.ru sentry.med-logic.ru
# change git url
git remote set-url origin https://git.med-logic.ru/ilya.muhortov/medicine-config.git
### Перенос данных
scp -r /root/medicine-config/medicine-lis-receiver/supervisor_confs root@192.168.11.121:/root/medicine-config/medicine-lis-receiver/supervisor_confs
scp -r /var/lib/docker/volumes/medicine_medicine-public-data/_data root@192.168.11.121:/var/lib/docker/volumes/medicine_medicine-public-data

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}"

4
update_repository.sh Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
(cd $SCRIPT_PATH && git pull)