pg_dump: aborting because of server version mismatch

From: Mitesh Shah <mitesh(dot)shah(at)stripes39(dot)com>
To: pgsql-admin(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org, adelaide-au-pug(at)postgresql(dot)org, seapug(at)postgresql(dot)org
Subject: pg_dump: aborting because of server version mismatch
Date: 2012-05-02 19:55:58
Message-ID: CAHofYQQ6yvHGCiHPBqTAL5fU=3haWXdE7oX-3=q=pcGYPajFxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: adelaide-au-pug atlpug austinpug bostonpug bwpug pgsql-admin pgsql-bugs pgsql-sql seapug sfpug

Hi,
I am trying to create a daily backup cron script but it fails with an error
as below:

Any pointers to resolve this will be greatly appreciated.

Thanks,
Mitesh Shah
mitesh(dot)shah(at)stripes39(dot)com

*(1) Error:*
bash-3.2$ sh pg_backup_rotated_orig.sh
Making backup directory in /Users/miteshshah/Documents/2012-05-02-daily/
-e

Performing full backups
-e --------------------------------------------

Plain backup of mitesh
*pg_dump: server version: 9.1.2; pg_dump version: 9.0.5*
*pg_dump: aborting because of server version mismatch*
-e
All database backups complete!

*(2.1) * /Users/miteshshah/Desktop/*pg_backup.config file:*
#############################
## POSTGRESQL BACKUP CONFIG ##
##############################
# hostname to adhere to pg_hba policies.
HOSTNAME= <host>

# username to connect to database as.
USERNAME=<user>

# Database name
DATABASE=<database>

# This dir will be created if it doesn't exist. This must be writable by
the user the script is
# running as.
BACKUP_DIR=<backup_dir>

# SCRIPTPATH
SCRIPTPATH=<path>

# Will produce a custom-format backup if set to "yes"
ENABLE_CUSTOM_BACKUPS=yes

# Will produce a gzipped plain-format backup if set to "yes"
ENABLE_PLAIN_BACKUPS=yes

#### SETTINGS FOR ROTATED BACKUPS ####

# Which day to take the weekly backup from (1-7 = Monday-Sunday)
DAY_OF_WEEK_TO_KEEP=5

# Number of days to keep daily backups
DAYS_TO_KEEP=7

# How many weeks to keep weekly backups
WEEKS_TO_KEEP=5

######################################

*(2.2) * /Users/miteshshah/Desktop/*pg_backup_rotated_orig.sh*
#!/bin/bash

###########################
####### LOAD CONFIG #######
###########################

source /Users/miteshshah/Desktop/pg_backup.config

###########################
#### START THE BACKUPS ####
###########################

function perform_backups()
{
SUFFIX=$1
FINAL_BACKUP_DIR=$BACKUP_DIR"`date +\%Y-\%m-\%d`$SUFFIX/"

echo "Making backup directory in $FINAL_BACKUP_DIR"

if ! mkdir -p $FINAL_BACKUP_DIR; then
echo "Cannot create backup directory in $FINAL_BACKUP_DIR.
Go and fix it!"
exit 1;
fi;

###########################
###### FULL BACKUPS #######
###########################

echo -e "\n\nPerforming full backups"
echo -e "--------------------------------------------\n"

if [ $ENABLE_PLAIN_BACKUPS = "yes" ]
then
echo "Plain backup of $DATABASE"

if ! pg_dump -Fp -h "$HOSTNAME" -U "$USERNAME"
"$DATABASE" | gzip > $FINAL_BACKUP_DIR"$DATABASE".sql.gz.in_progress; then
echo "[!!ERROR!!] Failed to produce plain
backup database $DATABASE"
else
mv
$FINAL_BACKUP_DIR"$DATABASE".sql.gz.in_progress
$FINAL_BACKUP_DIR"$DATABASE".sql.gz
fi
fi

if [ $ENABLE_CUSTOM_BACKUPS = "yes" ]
then
echo "Custom backup of $DATABASE"

if ! pg_dump -Fc -h "$HOSTNAME" -U "$USERNAME"
"$DATABASE" -f $FINAL_BACKUP_DIR"$DATABASE".custom.in_progress; then
echo "[!!ERROR!!] Failed to produce custom
backup database $DATABASE"
else
mv
$FINAL_BACKUP_DIR"$DATABASE".custom.in_progress
$FINAL_BACKUP_DIR"$DATABASE".custom
fi
fi

echo -e "\nAll database backups complete!"
}

# DAILY BACKUPS

# Delete daily backups 7 days old or more
find $BACKUP_DIR -maxdepth 1 -mtime +$DAYS_TO_KEEP -name "*-daily" -exec rm
-rf '{}' ';'

Responses

Browse adelaide-au-pug by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message Douglas, James 2010-03-16 22:47:31 ** PostgreSQL Developers NEEDED, SYDNEY Northern Beaches, $70K - 95K Package**

Browse atlpug by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message Carol Kampf 2012-02-29 11:03:08 Any chance you can forward this opening to your Atlanta members

Browse austinpug by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message cwiserr 2012-05-02 15:46:40 May AustinPUG speaker confirmed ...

Browse bostonpug by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message Thomas John Kincaid 2011-09-23 21:25:00 Re: Next Boston PUG?

Browse bwpug by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message Greg 2011-11-10 17:40:51 Meeting Tuesday, November 15: Managing High Volume Writes

Browse pgsql-admin by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message Kevin Grittner 2012-05-02 19:07:23 Re: grant select pg 9.0.3

Browse pgsql-bugs by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message Josh Kupershmidt 2012-05-02 18:54:58 Re: BUG #6624: Tab completion of identifier containing single backslash triggers warnings

Browse pgsql-sql by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message Andreas Gaab 2012-04-26 09:22:44 Running mean filtering using Window Functions?

Browse seapug by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message Ralph Smith 2012-05-01 22:57:32 Re: Tonights Meeting

Browse sfpug by date

  From Date Subject
Next Message Mitesh Shah 2012-05-02 19:58:07 pg_dump: aborting because of server version mismatch
Previous Message Glenn Zhu 2012-04-20 06:46:30 DBA job opportunity at Whitehat Security