From: Sorin N. Ciolofan <ciolofan@ics.forth.gr>
To: 'Marco Bizzarri' <marco.bizzarri@gmail.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: backup of postgres scheduled with cron
Date: Thu, 22 Nov 2007 15:46:15 +0200
Message-ID: <20071122134618.80DF18E40FC@mailhost.ics.forth.gr> (raw)
In-Reply-To: <3f0d61c40711220528k32a69464j6d37c584b8e93484@mail.gmail.com>
Hi Marco!
Thank you for the advice.
I got:
/home/swkm/services/test/backup.sh: line 4: pg_dump: command not found
updating: mydb_dump_22-11-07.out (stored 0%)
which seems strange
-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Marco Bizzarri
Sent: Thursday, November 22, 2007 3:28 PM
To: Sorin N. Ciolofan
Cc: pgsql-admin@postgresql.org; pgsql-general@postgresql.org
Subject: Re: [ADMIN] backup of postgres scheduled with cron
On Nov 22, 2007 2:19 PM, Sorin N. Ciolofan <ciolofan@ics.forth.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/
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: ciolofan@ics.forth.gr, marco.bizzarri@gmail.com, pgsql-general@postgresql.org
Subject: Re: backup of postgres scheduled with cron
In-Reply-To: <20071122134618.80DF18E40FC@mailhost.ics.forth.gr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox