pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Wittig <fw@weisshuhn.de>
To: Sorin N. Ciolofan <ciolofan@ics.forth.gr>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] backup of postgres scheduled with cron
Date: Thu, 22 Nov 2007 15:00:36 +0100
Message-ID: <47458B84.7000503@weisshuhn.de> (raw)
In-Reply-To: <20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr>
References: <20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr>

Hello Sorin!

Sorin N. Ciolofan wrote:

> 	#!/bin/bash
> 	time=`date '+%d'-'%m'-'%y'`
> 	cd /home/swkm/services/test
>       pg_dump mydb > mydb_dump_$time.out

You should output STDERR to some error logfile or set MAILTO in your
crontab.
I guess you then would have seen an error message saying that pg_dump
was not found because cron doesn't load the users environment and
therefore PATH variable isn't set.
I suggest you call pg_dump in your script by absolute path.

Greetings,
Frank Wittig

Attachments:

  signature.asc (application/pgp-signature, 250B) download

view thread (12+ messages)  latest in thread

Message-ID: <47458B84.7000503@weisshuhn.de>
Permalink:  ../47458B84.7000503@weisshuhn.de/
Also on:    postgresql.org/message-id/47458B84.7000503@weisshuhn.de

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: fw@weisshuhn.de, ciolofan@ics.forth.gr, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] backup of postgres scheduled with cron
  In-Reply-To: <47458B84.7000503@weisshuhn.de>

* 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