Re: [GENERAL] backup of postgres scheduled with cron

From: Frank Wittig <fw(at)weisshuhn(dot)de>
To: "Sorin N(dot) Ciolofan" <ciolofan(at)ics(dot)forth(dot)gr>
Cc: pgsql-admin(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] backup of postgres scheduled with cron
Date: 2007-11-22 14:00:36
Message-ID: 47458B84.7000503@weisshuhn.de
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-admin pgsql-general

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Andrew Sullivan 2007-11-22 14:04:00 Re: backup of postgres scheduled with cron
Previous Message Marco Bizzarri 2007-11-22 13:59:33 Re: backup of postgres scheduled with cron

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2007-11-22 14:04:00 Re: backup of postgres scheduled with cron
Previous Message Marco Bizzarri 2007-11-22 13:59:33 Re: backup of postgres scheduled with cron