Received: from mailf.telia.com (root@mailf.telia.com [194.22.194.25]) by hub.org (8.10.1/8.10.1) with ESMTP id e95K7qJ41112 for ; Thu, 5 Oct 2000 16:07:53 -0400 (EDT) Received: from dilbert (h234n2fls21o908.telia.com [213.64.153.234]) by mailf.telia.com (8.9.3/8.9.3) with SMTP id WAA29144 for ; Thu, 5 Oct 2000 22:07:50 +0200 (CEST) From: Gunnar Lindholm Reply-To: gunix@telia.com To: pgsql-admin@postgresql.org Subject: Re: Crontab and PostgreSQL Backup Date: Thu, 5 Oct 2000 21:53:41 +0200 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain References: <39DCCA3D.5D8FD5CF@lncc.br> In-Reply-To: <39DCCA3D.5D8FD5CF@lncc.br> MIME-Version: 1.0 Message-Id: <00100522053800.00314@dilbert> Content-Transfer-Encoding: 8bit X-Archive-Number: 200010/27 >I use PostgreSQL version 7.0.2 for Linux Conectiva 5.1 Server, and I > would like to know how do I do to configure and start the PostgreSQL's backup > and restore >using crontab? restore with crontab??? Anyway. Put a line in crontab like: 3 5 * * * /script/backdb.sh and the script /script/backdb.sh could then look like: #!/bin/bash DATE=`date +%Y%m%d` /usr/pgsql/bin/pg_dump databas > /tmp/dump.$DATE then you have a file in /tmp/dump.$DATE that you could put on tape or whatever you use. Use pg_dumpall if you want all databases. You might want to consider making a backup of the files (for example pg_hba.conf) in PGDATA directory. Read the man page for details about OID's. Good luck. Gunnar.