pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Spike Grobstein <spike@ticketevolution.com>
To: teyking2003 <tchongking@hotmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Cronjob to autobackup database
Date: Tue, 4 Dec 2012 09:51:32 -0500
Message-ID: <4422292F-040B-4DE8-AA2A-2A5F1C201B65@ticketevolution.com> (raw)
In-Reply-To: <1354583597299-5734873.post@n5.nabble.com>
References: <1354583597299-5734873.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

You can debug what's going wrong with the script by adding this:

30 09 * * * /autopgdump.sh &> /autopgdump.log

that will write the output of the command to a logfile living at /autopgdump.log. If there's anything wrong with your environment (something not in the PATH of the user running the cron, etc) it should be written there. Cron runs with a slightly different environment than a regular login shell, so this can help you figure out exactly what's going wrong.

note: each time cron executes that script, it will replace the contents of /autopgdump.log; not append to it.

Also, just to double check, the above configuration would run the script at 9:30am every day, so did you wait until 9:30 for the script to run?



...spike


On Dec 3, 2012, at 8:13 PM, teyking2003 wrote:

> i  have a cronjob setting up as below
> 1)Command crontab -e 
> 2)Keyin 30 09 * * * /autopgdump.sh
> 3) Save to new crontab file.
> but nothing happen, the backup process won't start.
> 
> i manage to perform manual backup by running the following command
> sudo ./autopgdump.sh( SH file store under root directory
> 
> looking for the correct ways to setting up the cronjob.
> 
> thanks
> 
> 
> 
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/Cronjob-to-autobackup-database-tp5734873.html
> Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
> 
> 
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (8+ messages)  latest in thread

Message-ID: <4422292F-040B-4DE8-AA2A-2A5F1C201B65@ticketevolution.com>
Permalink:  ../4422292F-040B-4DE8-AA2A-2A5F1C201B65@ticketevolution.com/
Also on:    postgresql.org/message-id/4422292F-040B-4DE8-AA2A-2A5F1C201B65@ticketevolution.com

 · 

reply

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: spike@ticketevolution.com, tchongking@hotmail.com
  Subject: Re: Cronjob to autobackup database
  In-Reply-To: <4422292F-040B-4DE8-AA2A-2A5F1C201B65@ticketevolution.com>

* 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