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

Thank you all,

Yes, I used the absolute path in my script and now works ok :-)

Thank you again
Sorin

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Frank Wittig
Sent: Thursday, November 22, 2007 4:01 PM
To: Sorin N. Ciolofan
Cc: pgsql-admin@postgresql.org; pgsql-general@postgresql.org
Subject: Re: [GENERAL] backup of postgres scheduled with cron

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






view thread (12+ messages)  latest in thread

Message-ID: <20071122141513.B6F2E8E40FC@mailhost.ics.forth.gr>
Permalink:  ../20071122141513.B6F2E8E40FC@mailhost.ics.forth.gr/
Also on:    postgresql.org/message-id/20071122141513.B6F2E8E40FC@mailhost.ics.forth.gr

 · 

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: ciolofan@ics.forth.gr, fw@weisshuhn.de, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] backup of postgres scheduled with cron
  In-Reply-To: <20071122141513.B6F2E8E40FC@mailhost.ics.forth.gr>

* 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