Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 48F302E0044 for ; Thu, 22 Nov 2007 09:28:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 69911-05 for ; Thu, 22 Nov 2007 09:28:19 -0400 (AST) Received: from mx2.hub.org (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 99BBA2E004C for ; Thu, 22 Nov 2007 09:28:19 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.231]) by mx2.hub.org (Postfix) with ESMTP id 54FCB12A68D7 for ; Thu, 22 Nov 2007 09:28:19 -0400 (AST) Received: by wx-out-0506.google.com with SMTP id r21so955351wxc for ; Thu, 22 Nov 2007 05:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=J5ibKqo0gI24nCZCMpRDQFxVo4XWaGP1i+Opr+4JSUg=; b=pSutLnzjIuNxIEXibAalc5dbEQ4KElrrdZ3igMXZ5ElE/ldvDIHC9DaEYXNcGzd4Xs0y/ms+V2niqkqKcdwl8kTb+Evo/o7wHpRXBJDZmNGD5fNe5Jlr0Nkt4mR2GxjoTjk4+nixtJFVqFcfP7TxnOn1dn9gTmfEiIj9/VnExZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lHUe5GehYan5VhPN//Z32Gc4jbLAly6hwt6yLhL+dB4paI2EmuNXtGGD8RxJsOWCxP9yiYea2d343FnEBtVigDZByMbC+3avysMTKa63YBDfojY7+5KOU7VVnoAZIhsxt7MrJHaQKATel7ujDi8C+5+77Fw2GWwh7YbuZXA6wBI= Received: by 10.70.56.10 with SMTP id e10mr9447691wxa.1195738088087; Thu, 22 Nov 2007 05:28:08 -0800 (PST) Received: by 10.70.29.8 with HTTP; Thu, 22 Nov 2007 05:28:08 -0800 (PST) Message-ID: <3f0d61c40711220528k32a69464j6d37c584b8e93484@mail.gmail.com> Date: Thu, 22 Nov 2007 14:28:08 +0100 From: "Marco Bizzarri" To: "Sorin N. Ciolofan" Subject: Re: backup of postgres scheduled with cron Cc: pgsql-admin@postgresql.org, pgsql-general@postgresql.org In-Reply-To: <20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/192 X-Sequence-Number: 27435 On Nov 22, 2007 2:19 PM, 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? > > Thanks > Sorin > Hi Sorin, why don't you add a "MAILTO=" at the start of your crontab file, so that you can receive a report of the problem? Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/