From: | "philip johnson" <philip(dot)johnson(at)atempo(dot)com> |
---|---|
To: | <terry(at)greatgulfhomes(dot)com> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Help automate pg_dump |
Date: | 2002-06-18 15:38:39 |
Message-ID: | NDBBJLHHAKJFNNCGFBHLGEEBDJAA.philip.johnson@atempo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
in the crontab of postgres user you could use
0 6 * * * ( cd /appl_logs/postgresql/ && /opt/pgsql/pg_backup.sh -db
dbname )
and pg_backup.sh could be like this
#!/bin/bash
#
# pg_backup.sh
#
# Database backup
#
# Parametres :
# -db <db name>
#
# a file (with the following format <db name>.<date>-<hour>.dump.gz) will be
created in the current
# directory
#
usage()
{
echo "`basename $0` -db <db name>"
exit 1
}
if [ "$1" != "-db" ]; then
usage
fi
DBNAME="$2"
DATE=`date +%Y%m%d`
TIME=`date +%H%M`
SAV_DB_FILENAME="$DBNAME.$DATE-$TIME.dump.gz"
~postgres/bin/pg_dump $DBNAME | gzip -c9 >$SAV_DB_FILENAME
-----Message d'origine-----
De : pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org]De la part de
terry(at)greatgulfhomes(dot)com
Envoyé : mardi 18 juin 2002 15:24
À : nothanks(at)nowhere(dot)com; pgsql-general(at)postgresql(dot)org
Objet : Re: [GENERAL] Help automate pg_dump
Hmmm.
Please let the list know if you get a solution, I am about to go to 7.2 on
my production machines but that could be a show stopper if the cron job
cannot automatically back it up anymore.
Terry Fielder
Network Engineer
Great Gulf Homes / Ashton Woods Homes
terry(at)greatgulfhomes(dot)com
> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of
> nothanks(at)nowhere(dot)com
> Sent: Monday, June 17, 2002 10:01 PM
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] Help automate pg_dump
>
>
> We just upgraded from 7.1.3 to 7.2.1 and are at a loss on how to
> script the pg_dump routine. We use this tool for backup, but can not
> get around the requirement for username/password to be interactive.
>
> We require login from the localhost, and can not revert to trusted
> connections.
>
> If the username/password must be interactive, how can I script backup
> of the server?
>
> Evan,
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Beutin | 2002-06-18 15:43:58 | Re: Wierd Explain |
Previous Message | Scott Marlowe | 2002-06-18 15:09:52 | Re: Monitoring postgres slowdowns |