Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 117992E0046 for ; Thu, 22 Nov 2007 09:50:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 16144-06 for ; Thu, 22 Nov 2007 09:50:04 -0400 (AST) Received: from agave.telenet-ops.be (agave.telenet-ops.be [195.130.137.77]) by postgresql.org (Postfix) with ESMTP id DBEDA2E004E for ; Thu, 22 Nov 2007 09:50:09 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by agave.telenet-ops.be (Postfix) with SMTP id 8477F67D8E for ; Thu, 22 Nov 2007 14:50:07 +0100 (CET) Received: from mordor.objectit.be (dD5E02CD8.access.telenet.be [213.224.44.216]) by agave.telenet-ops.be (Postfix) with ESMTP id 778C467D6A for ; Thu, 22 Nov 2007 14:50:07 +0100 (CET) Received: by mordor.objectit.be (Postfix, from userid 1000) id 7F0745DA5E; Thu, 22 Nov 2007 14:50:07 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mordor.objectit.be (Postfix) with ESMTP id 7C80747B3D for ; Thu, 22 Nov 2007 14:50:07 +0100 (CET) Date: Thu, 22 Nov 2007 14:50:07 +0100 (CET) From: jef.peeraer@telenet.be X-X-Sender: jpe@mordor.objectit.be Reply-To: jef.peeraer@telenet.be To: pgsql-general@postgresql.org Subject: Re: backup of postgres scheduled with cron In-Reply-To: <20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr> Message-ID: References: <20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.297 tagged_above=0 required=5 tests=AWL=0.482, BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 200711/1207 X-Sequence-Number: 124203 On Thu, 22 Nov 2007, Sorin N. Ciolofan wrote: > Hello all! > > I've a small bash script backup.sh for creating dumps on my Postgre db: > > #!/bin/bash > time=`date '+%d'-'%m'-'%y'` > cd /home/swkm/services/test > pg_dump mydb > mydb_dump_$time.out > > I've edited crontab and added a line: > > 00 4 * * * swkm /home/swkm/services/test/backup.sh > > to execute the backup.sh as user swkm daily at 4 am. > > The user swkm is the user I use to create backups manually. The script > itself is executed fine if run manually but run on cron scheduler I got an > mydb_dump_$time.out file empty (of 0 kb) > > Do you have any idea about what's wrong? you have to pass the -U argument to pg_dump, otherwise it'll try to run the script as root jef > > Thanks > Sorin > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > >