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: 20071122131908.F1D0F8E40FC@mailhost.ics.forth.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

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

In response to

Responses

Browse pgsql-admin by date

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

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-11-22 13:25:27 Re: BEGIN strange behaviour
Previous Message luca.ciciriello 2007-11-22 13:10:49 BEGIN strange behaviour