Zmiany pomiędzy wersją 32 and wersją 33 dla AdminGuide/Procedures/RoboAutoUpdate
- Data i czas:
- 08/09/23 18:40:05 (16 months temu)
Legend:
- Bez zmian
- Dodane
- Usunięte
- Zmienione
-
AdminGuide/Procedures/RoboAutoUpdate
v32 v33 7 7 {{{ 8 8 #!/bin/bash 9 10 11 9 12 WDAY=$(date +%w) 13 DST="/mnt/backup/db/${WDAY}" 14 OPTIONS="--force --ignore-errors --delete --delete-excluded \ 15 --exclude-from='/etc/backup/exclude_test.conf' -a" 10 DATE=$(date +"%Y%m%d") 11 DST="/home/backup/db" 12 OPTIONS="--force --ignore-errors --delete --delete-excluded \ 13 --exclude-from=/etc/backup/exclude_test.conf -a" 14 DATESTART=$(date +"%Y-%m-%d %H:%M") 15 echo "Start odtworzenie wersji ROBO ${DATESTART}" >> /var/log/restore_robo_version.log 16 16 17 17 18 18 19 if [ "$WDAY" -lt 1 -o "$WDAY" -gt 6 ] 20 then 21 exit 1 22 fi 19 su - postgres -c "psql -c \"SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'test' AND pid <> pg_backend_pid();\"" 23 20 24 #Reset połączeń do bazy test, uniknięcie problemów odtwarzania bazy na bazę 25 su - postgres -c "psql -c \"SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'test' AND pid <> pg_backend_pid();\"" 26 27 su - postgres -c "dropdb test" 28 su - postgres -c "createdb -O edokumenty test" 29 su - postgres -c "gunzip -c $DST/edokumenty.sql.gz | psql test" 21 su - postgres -c "dropdb test" 22 su - postgres -c "createdb -O edokumenty test" 23 su - postgres -c "gunzip -c $DST/edokumenty_${DATE}.sql.gz | psql test" 30 24 31 25 #Usunięcie konta ePUAP