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

backup of postgres scheduled with cron

From: "Sorin N(dot) Ciolofan" <ciolofan(at)ics(dot)forth(dot)gr>
To: <pgsql-admin(at)postgresql(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: backup of postgres scheduled with cron
Date: 2007-11-22 13:19:06
Message-ID: (view raw or whole thread)
Lists: pgsql-adminpgsql-general
Hello all!

I've a small bash script for creating dumps on my Postgre db:

	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/

to execute the 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?


In response to


pgsql-admin by date

Next:From: Marco BizzarriDate: 2007-11-22 13:28:08
Subject: Re: backup of postgres scheduled with cron
Previous:From: Oleg BartunovDate: 2007-11-22 10:57:34
Subject: Re: EAV or not to EAV?

pgsql-general by date

Next:From: Martijn van OosterhoutDate: 2007-11-22 13:25:27
Subject: Re: BEGIN strange behaviour
Previous:From: luca.cicirielloDate: 2007-11-22 13:10:49
Subject: BEGIN strange behaviour

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