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

Re: backup of postgres scheduled with cron

From: "Marco Bizzarri" <marco(dot)bizzarri(at)gmail(dot)com>
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: backup of postgres scheduled with cron
Date: 2007-11-22 13:28:08
Message-ID: 3f0d61c40711220528k32a69464j6d37c584b8e93484@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-general
On Nov 22, 2007 2:19 PM, Sorin N. Ciolofan <ciolofan(at)ics(dot)forth(dot)gr> wrote:
> Hello all!
>
> I've a small bash script backup.sh for creating dumps on my Postgre db:
>
>         #!/bin/bash
>         time=`date '+%d'-'%m'-'%y'`
>         cd /home/swkm/services/test
>       pg_dump mydb > mydb_dump_$time.out
>
> I've edited crontab and added a line:
>
> 00 4 * * * swkm /home/swkm/services/test/backup.sh
>
> to execute the backup.sh as user swkm daily at 4 am.
>
> The user swkm is the user I use to create backups manually. The script
> itself is executed fine if run manually but run on cron scheduler I got an
> mydb_dump_$time.out file empty (of 0 kb)
>
> Do you have any idea about what's wrong?
>
> Thanks
> Sorin
>

Hi Sorin,

why don't you add a "MAILTO=<youraddress>" at the start of your
crontab file, so that you can receive a report of the problem?

Regards
Marco

-- 
Marco Bizzarri
http://iliveinpisa.blogspot.com/

In response to

Responses

pgsql-admin by date

Next:From: Sorin N. CiolofanDate: 2007-11-22 13:46:15
Subject: Re: backup of postgres scheduled with cron
Previous:From: Sorin N. CiolofanDate: 2007-11-22 13:19:06
Subject: backup of postgres scheduled with cron

pgsql-general by date

Next:From: Andrew SullivanDate: 2007-11-22 13:28:25
Subject: Re: BEGIN strange behaviour
Previous:From: Martijn van OosterhoutDate: 2007-11-22 13:25:27
Subject: Re: BEGIN strange behaviour

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