Re: backup of postgres scheduled with cron - Mailing list pgsql-general

From Frank Wittig
Subject Re: backup of postgres scheduled with cron
Date
Msg-id 47458B84.7000503@weisshuhn.de
Whole thread Raw
In response to backup of postgres scheduled with cron  ("Sorin N. Ciolofan" <ciolofan@ics.forth.gr>)
Responses Re: backup of postgres scheduled with cron  ("Sorin N. Ciolofan" <ciolofan@ics.forth.gr>)
List 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


Attachment

pgsql-general by date:

Previous
From: "Marco Bizzarri"
Date:
Subject: Re: [ADMIN] backup of postgres scheduled with cron
Next
From: Andrew Sullivan
Date:
Subject: Re: [ADMIN] backup of postgres scheduled with cron