title: PIVOTAL HAWQ Backup - shell script error
body: <p>When I am trying to backup PIVOTAL HAWQ database using shell script. </p>
  
  <p><strong>Getting error :</strong></p>
  
  <pre><code>/home/gpadmin/backup_db.sh: line 12: pg_dump: command not found
  </code></pre>
  
  <p><strong>Input shell script</strong>:backup_db.sh</p>
  
  <pre><code>#!/bin/bash
  # Location to place backup.
  backup_dir="/home/backup/"
  #String to append at the name of the backup files
  backup_date=`date +%d-%m-%Y`
  #Numbers of days we want to keep copy databases
  number_of_days=7
  databases=(prod test gpadmin)
  for i in ${databases[@]}; do
    if [ "$i" != "template0" ] &amp;&amp; [ "$i" != "template1" ]; then
      echo Dumping $i to $backup_dir$i\_$backup_date
      pg_dump $i|gzip &gt; $backup_dir$i\_$backup_date.gz
    fi
  done
  find $backup_dir -type f -prune -mtime +$number_of_days -exec rm -f {} \;
  </code></pre>
  
  <p><strong>CRONTAB :</strong>
  ENTRY FOR SHELL SCRIPT - */5 * * * * /home/gpadmin/backup_db.sh > /tmp/bkp.log</p>
  
  <p>When running the shell manually dumping the data. But at the same time not working via crontab which runs every 5 minute.</p>
  
  <p>Any help on it would be much appreciated. </p>