From sgnerd@yahoo.com.sg Fri Sep 19 05:29:35 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C0862D1B4EC for ; Fri, 19 Sep 2003 05:29:35 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 58135-05 for ; Fri, 19 Sep 2003 02:29:04 -0300 (ADT) Received: from smtp011.mail.yahoo.com (smtp011.mail.yahoo.com [216.136.173.31]) by svr1.postgresql.org (Postfix) with SMTP id 03130D1B4E1 for ; Fri, 19 Sep 2003 02:29:03 -0300 (ADT) Received: from ptil-138-190-chn.primus-india.net (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 19 Sep 2003 05:29:02 -0000 Message-ID: <024b01c37e6f$a93fb4a0$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "psql" Subject: Automated Backup Date: Fri, 19 Sep 2003 11:04:07 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_023A_01C37E9D.BED2D800" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_60_70 X-Spam-Level: X-Archive-Number: 200309/179 X-Sequence-Number: 15157 This is a multi-part message in MIME format. ------=_NextPart_000_023A_01C37E9D.BED2D800 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear Gurus, Is there a way to automate the backup databases using pg_dump (like in SQL = server)? Regards Kumar ------=_NextPart_000_023A_01C37E9D.BED2D800 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear Gurus,
 
Is there a way to automate the backup databases us= ing=20 pg_dump (like in SQL server)?
 
Regards
Kumar

------=_NextPart_000_023A_01C37E9D.BED2D800-- From bhuvan@symonds.net Fri Sep 19 07:39:53 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DE2D5D1B503 for ; Fri, 19 Sep 2003 07:39:53 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 74405-06 for ; Fri, 19 Sep 2003 04:39:23 -0300 (ADT) Received: from Gateway.bksys.co.in (unknown [61.3.64.17]) by svr1.postgresql.org (Postfix) with ESMTP id A6E16D1B4E3 for ; Fri, 19 Sep 2003 04:39:16 -0300 (ADT) Received: from bksys.co.in (mail.bksys.co.in [192.168.1.1]) by Gateway.bksys.co.in (8.11.6/8.11.6) with ESMTP id h8J7d5D01421; Fri, 19 Sep 2003 13:09:07 +0530 Received: from Bhuvan.bksys.co.in (Bhuvan.bksys.co.in [192.168.1.71]) by bksys.co.in (8.11.6/8.8.5) with ESMTP id h8J7d3B14078; Fri, 19 Sep 2003 13:09:03 +0530 Date: Fri, 19 Sep 2003 13:17:33 +0530 (IST) From: "A.Bhuvaneswaran" X-X-Sender: bhuvan@Bhuvan.bksys.co.in To: Kumar Cc: psql Subject: Re: Automated Backup In-Reply-To: <024b01c37e6f$a93fb4a0$7502a8c0@hdsc.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/184 X-Sequence-Number: 15162 > Is there a way to automate the backup databases using pg_dump (like in > SQL server)? You can use cron to automate your backup process with pg_dump. regards, bhuvaneswaran From btober@seaworthysys.com Fri Sep 19 08:31:42 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 61E86D1B502 for ; Fri, 19 Sep 2003 08:31:42 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 81700-10 for ; Fri, 19 Sep 2003 05:31:13 -0300 (ADT) Received: from mail.seaworthysystems.com (216-238-112-88.dsl.ct.thebiz.net [216.238.112.88]) by svr1.postgresql.org (Postfix) with ESMTP id 52C4DD1B4E9 for ; Fri, 19 Sep 2003 05:31:11 -0300 (ADT) Received: from seaworthysystems.com (localhost.localdomain [127.0.0.1]) by mail.seaworthysystems.com (Postfix) with SMTP id F3ACA1B693 for ; Fri, 19 Sep 2003 04:37:29 -0400 (EDT) Received: from 66.212.203.144 (SquirrelMail authenticated user btober) by $HOSTNAME with HTTP; Fri, 19 Sep 2003 04:37:30 -0400 (EDT) Message-ID: <64812.66.212.203.144.1063960650.squirrel@$HOSTNAME> Date: Fri, 19 Sep 2003 04:37:30 -0400 (EDT) Subject: Re: Automated Backup From: To: In-Reply-To: References: <024b01c37e6f$a93fb4a0$7502a8c0@hdsc.com> X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.9) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/228 X-Sequence-Number: 15206 > >> Is there a way to automate the backup databases using pg_dump (like >> in SQL server)? > Ha! Why would you want to do ANYTHING "like in SQL server"! ;) You can do you back-ups very nicely using cron and a bash script: bash-2.05a$ crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.22116 installed on Fri Jun 13 10:41:06 2003) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) 11 02 * * 1-6 /usr/local/bin/dump paid postgres@btober.com Slightly edited, but illustrates the point: bash-2.05a$ cat /usr/local/bin/dump #!/bin/bash # Script to dump a PostgreSQL database, producing # compressed tar file containing with pg_dump output. # Author: Berend M. Tober # Date: August 25, 2003 if [ "${1}" = "" ] then echo "Must specify database name" exit 0 fi # setup variables NAIL=/usr/local/bin/nail PG_DUMP=/usr/bin/pg_dump TAR=/bin/tar DBNAME=${1} UNAME=postgres TARGET_EMAIL=${2} OUTPUT_FILE=${DBNAME}.`date +%Y%m%d` # create dump file ${PG_DUMP} -Fc -U ${UNAME} ${DBNAME} > ~/${OUTPUT_FILE}.dump # create compressed archive of dump (and other) files ${TAR} -czf ~/${OUTPUT_FILE}.tar.gz ${OUTPUT_FILE}.dump # above line uses tar rather than just gzip # because in reality other files are included in # my backup archive but which have been omitted # in this mailing list post for simplicity. # optionally mail the back-up archive offsite if [ "${2}" != "" ] then echo|${NAIL} -r ${UNAME} -a ~/${OUTPUT_FILE}.tar.gz -s ${OUTPUT_FILE}.tar.gz ${2} fi From cbbrowne@acm.org Fri Sep 19 11:40:01 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C91C3D1B4FE for ; Fri, 19 Sep 2003 11:40:01 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 22027-06 for ; Fri, 19 Sep 2003 08:39:53 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id EBA2FD1B509 for ; Fri, 19 Sep 2003 08:39:50 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h8JBdosn051829 for ; Fri, 19 Sep 2003 11:39:50 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h8JBCQTM048422 for pgsql-sql@postgresql.org; Fri, 19 Sep 2003 11:12:26 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Automated Backup Date: Fri, 19 Sep 2003 06:42:54 -0400 Organization: cbbrowne Computing Inc Lines: 14 Message-ID: References: <024b01c37e6f$a93fb4a0$7502a8c0@hdsc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:VVsN6onlcTMhrsKuF8xijvwDYX8= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/190 X-Sequence-Number: 15168 Oops! sgnerd@yahoo.com.sg ("Kumar") was seen spray-painting on a wall: > Is there a way to automate the backup databases using pg_dump (like in SQL server)? If you can come up with a way of automating the running of programs, then I imagine that might be possible. I have heard that a program called "cron" might be used for this purpose. -- "aa454","@","freenet.carleton.ca" http://cbbrowne.com/info/x.html People can be set wondering by loading obscure personal patchable systems, and sending bug reports. Who would not stop and wonder upon seeing "Experimental TD80-TAPE 1.17, MegaDeath 2.5..."? The same for provocatively-named functions and variables in stack traces. -- from the Symbolics Guidelines for Sending Mail