Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-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

pgsql-admin by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group