файл:
$ sudo sh script.sh
INFO: Backup start, pg_probackup version: 2.1.1, backup ID: PRT6WS, backup mode: full, instance: main, stream: true, remote false
INFO: Start transfering data files
INFO: Data files are transfered
INFO: wait for pg_stop_backup()
INFO: pg_stop backup() successfully executed
INFO: Validating backup PRT6WS
INFO: Backup PRT6WS data files are valid
INFO: Backup PRT6WS completed
INFO: Evaluate backups by retention
INFO: Backup PRT6WS, mode: FULL, status: OK. Redundancy: 1/5, Time Window: 0,00d/0d. Active
INFO: Backup PRT215, mode: FULL, status: OK. Redundancy: 2/5, Time Window: 0,07d/0d. Active
INFO: Backup PRPKBE, mode: FULL, status: OK. Redundancy: 3/5, Time Window: 1,96d/0d. Active
INFO: Backup PRPJMB, mode: FULL, status: OK. Redundancy: 4/5, Time Window: 1,97d/0d. Active
INFO: Backup PRPJ1V, mode: FULL, status: OK. Redundancy: 5/5, Time Window: 1,98d/0d. Active
INFO: Backup PRPF39, mode: FULL, status: OK. Redundancy: 6/5, Time Window: 2,04d/0d. Expired
INFO: Delete: PRPF39 2019-05-18 17:37:10+03
INFO: removed min WAL segment "00000002000000010000008F.00000028.backup"
INFO: removed max WAL segment "000000020000000100000091.gz"
INFO: There are no backups to merge by retention policy
INFO: Purging finished
Вот так не хочет:
DATA=date +"%Y-%m-%d_%H-%M-%S"
sudo -u postgres pg_probackup-10 backup -B /backupwal --instance main -b FULL --stream --compress --delete-wal --expired > pg_probackup.txt
if [ $? -ne 0 ]
then
echo "pg_probackup неудачное завершение" | mutt -s 'pg_probackup '$DATA' - неудачное завершение' f1@vt70.com -a pg_probackup.txt
else
echo "pg_probackup удачное завершение" | mutt -s 'pg_probackup '$DATA' - удачное завершение' f1@vt70.com -a pg_probackup.txt
fi
Как сделать правильно что бы каждый раз лог обновлялся?
а Вы не хотите просто заиспользовать опцию --log-level-file ?
Обсуждают сегодня