pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jef.peeraer@telenet.be
To: pgsql-general@postgresql.org
Subject: Re: backup of postgres scheduled with cron
Date: Thu, 22 Nov 2007 14:50:07 +0100 (CET)
Message-ID: <Pine.LNX.4.61.0711221448570.8478@mordor.objectit.be> (raw)
In-Reply-To: <20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr>
References: <20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr>



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
> 
> 



view thread (12+ messages)  latest in thread

Message-ID: <Pine.LNX.4.61.0711221448570.8478@mordor.objectit.be>
Permalink:  ../Pine.LNX.4.61.0711221448570.8478@mordor.objectit.be/
Also on:    postgresql.org/message-id/Pine.LNX.4.61.0711221448570.8478@mordor.objectit.be

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jef.peeraer@telenet.be, pgsql-general@postgresql.org
  Subject: Re: backup of postgres scheduled with cron
  In-Reply-To: <Pine.LNX.4.61.0711221448570.8478@mordor.objectit.be>
  References: <20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr> <Pine.LNX.4.61.0711221448570.8478@mordor.objectit.be>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox