error messages not getting logged when running script from cron

Поиск
Список
Период
Сортировка
От anj patnaik
Тема error messages not getting logged when running script from cron
Дата
Msg-id CAEQKwSna_Jq8t+4fEqorN-6jcE54YwtqpkEQR0fmSJhcZ_fTaQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: error messages not getting logged when running script from cron
Re: error messages not getting logged when running script from cron
Список pgsql-general
I have a cron script that does the following:

PGPASSWORD=$PGPASSWORD /opt/PostgreSQL/9.4/bin/pg_dump -t RECORDER -Fc $i -U postgres -Z0 | xz -9 > "$backup_dir/$i-$timeslot-database"

xzcat "$backup_dir/$i-$timeslot-database" | /opt/PostgreSQL/9.4/bin/pg_restore -h $backupHost -U postgres -d backupDB -c -p 5434 -v

My cron tab entry:

0 20 * * * db_backup.sh 1> /dev/null 2>&1 | mail -s "backup cron" myemail@comp.com

I am re-directing stderr to stdout and then sending that to email.

I get an email nightly with that title, but no error messages.

Last night, the restore never finished, but there was no error output.

Any ideas to get an email with error info.

thanks a lot



В списке pgsql-general по дате отправления: