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

Re: backup of postgres scheduled with cron

From: jef(dot)peeraer(at)telenet(dot)be
To: pgsql-general(at)postgresql(dot)org
Subject: Re: backup of postgres scheduled with cron
Date: 2007-11-22 13:50:07
Message-ID: Pine.LNX.4.61.0711221448570.8478@mordor.objectit.be (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-adminpgsql-general

On Thu, 22 Nov 2007, Sorin N. Ciolofan 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?
you have to pass the -U argument to pg_dump, otherwise it'll try to run 
the script as root


jef
> 
> Thanks
> Sorin
> 
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
> 
> 

In response to

pgsql-admin by date

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

pgsql-general by date

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

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