Search Postgresql Archives

error messages not getting logged when running script from cron

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux