#!/bin/bash
OUTPUT='/data_disk/pgBackup'
dateStr=`date '+%F_%H'`
echo "Date: $dateStr"

# pg_dump -h 172.17.0.7 -U redmineuser -d redminedb -f /home/epm/pgbackup/redminedb_tecent.sql 
echo "exporting redminedb" 
/usr/pgsql-14/bin/pg_dump -h 172.17.0.7 -U redmineuser -d redminedb -f $OUTPUT/redminedb_tecent_$dateStr.sql 
if [ $? != "0" ]; then
        echo "exporting fails"
else
        echo "exporting success"
fi