Even though it's not listed in any of the documentation or “pg_dump --help” you can check the return code of the process. A return code greater than 0 (zero) usually indicates
a failure ./bin >pg_dump -U dummy_user dummy_database; echo $? 1 From: pgsql-performance-owner@xxxxxxxxxxxxxx [mailto:pgsql-performance-owner@xxxxxxxxxxxxxx]
On Behalf Of Rick Otten Although it doesn't really tell if the pg_dump was successful (you'll need to do a full restore to be sure), I generate an archive list. If that fails, the backup clearly wasn't successful, and if it succeeds, odds are pretty good that
it worked: -- bash code snippet -- archiveList=`pg_restore -l ${backupFolder}` if [[ ! ${archiveList} =~ "Archive created at" ]] then echo "PostgreSQL backup - Archive List Test Failed for ${hostName}:${dbName}" echo "Archive listing:" echo ${archiveList} exit 1 fi ----------------------- On Mon, Feb 27, 2017 at 4:35 AM, Dinesh Chandra 12108 <Dinesh.Chandra@xxxxxxxxxx> wrote: Hi, We are taking daily full backup of PostgreSQL database using
PG_DUMP which is automatic scheduled through Cronjobs. How can I check my yesterday backup is successfully or not? Is there any query or view by which I can check it? Regards, Dinesh Chandra |Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida. ------------------------------------------------------------------ Mobile:
+91-9953975849 | Ext 1078
|dinesh.chandra@xxxxxxxxxx Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.
|