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@xxxxxxxx
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