X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4CD36D9AD6 for ; Mon, 10 Oct 2005 03:48:56 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 60266-08 for ; Mon, 10 Oct 2005 06:48:53 +0000 (GMT) Received: from antivirus.unimo.it (antivirus.unimo.it [155.185.1.3]) by svr1.postgresql.org (Postfix) with ESMTP id CDA58D9ABC for ; Mon, 10 Oct 2005 03:48:53 -0300 (ADT) Received: from [155.185.48.190] (fluca.ing.unimo.it [155.185.48.190]) by antivirus.unimo.it (8.12.11/8.12.11) with ESMTP id j9A6mr1E015718 for ; Mon, 10 Oct 2005 08:48:53 +0200 Message-ID: <434A0EDB.9090308@infinito.it> Date: Mon, 10 Oct 2005 08:48:59 +0200 From: Luca Ferrari User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: pg_dump References: <221385EC3F18A44DB0925467A1D2395F38F8D9@exsrv3.workskillsprofessionals.com.au> In-Reply-To: <221385EC3F18A44DB0925467A1D2395F38F8D9@exsrv3.workskillsprofessionals.com.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-milter on antivirus (http://amavis.org/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.516 required=5 tests=[FROM_ENDS_IN_NUMS=0.516] X-Spam-Level: X-Archive-Number: 200510/100 X-Sequence-Number: 19172 Nirav Parikh's cat, on 10/10/2005 7.30, walking on the keyboard wrote: > Hi, > > I am trying to write cronjob so it will backup database everynight on > another machine. > Currently is doing it on the same machine with this script. > > 20 13 * * * pg_dump -F c -f /root/database.pgdump database > > How can I send it to different machine. Machine IP address is > 192.168.1.13 You can use ssh to copy the dump file to another machine. Configuring ssh to use ssh_agent you will not be required to insert a passwrod, thus you can do it automatically. I guess there's also an option to specify the password on the command line. > > Is it possible to write pg_restore job ones it finishes dumping on that > machine? I guess you can write a shell script that checks, periodically, if the restore file has been copied, then restores it and delete the files (thus to not restore it infinitely). Luca -- Luca Ferrari fluca1978@infinito.it