pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedCronjob to autobackup database
8+ messages / 5 participants
[nested] [flat]
* Cronjob to autobackup database
@ 2012-12-04 01:13 teyking2003 <tchongking@hotmail.com>
0 siblings, 3 replies; 8+ messages in thread
From: teyking2003 @ 2012-12-04 01:13 UTC (permalink / raw)
To: pgsql-admin
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
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Cronjob to autobackup database
@ 2012-12-04 14:35 Krawetzky, Peter J <KrawetzkyPJ@aetna.com>
parent: teyking2003 <tchongking@hotmail.com>
2 siblings, 1 reply; 8+ messages in thread
From: Krawetzky, Peter J @ 2012-12-04 14:35 UTC (permalink / raw)
To: pgsql-admin
Here is a crontab example. I always specify the absolute path.
0 0 * * * /postgresql/home/scripts/backup/backup_wal_enabled_instance.sh inst1 5432
Peter Krawetzky
-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of teyking2003
Sent: Monday, December 03, 2012 8:13 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Cronjob to autobackup database
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
This e-mail may contain confidential or privileged information. If
you think you have received this e-mail in error, please advise the
sender by reply e-mail and then delete this e-mail immediately.
Thank you. Aetna
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Cronjob to autobackup database
@ 2012-12-04 14:51 Spike Grobstein <spike@ticketevolution.com>
parent: teyking2003 <tchongking@hotmail.com>
2 siblings, 0 replies; 8+ messages in thread
From: Spike Grobstein @ 2012-12-04 14:51 UTC (permalink / raw)
To: teyking2003 <tchongking@hotmail.com>; +Cc: pgsql-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
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Cronjob to autobackup database
@ 2012-12-05 00:48 teyking2003 <tchongking@hotmail.com>
parent: Krawetzky, Peter J <KrawetzkyPJ@aetna.com>
0 siblings, 2 replies; 8+ messages in thread
From: teyking2003 @ 2012-12-05 00:48 UTC (permalink / raw)
To: pgsql-admin
so if i putting the .SH files under root directory
the cronjob will look similar like
30 09 * * * /root/autopgdump.sh
please advice?
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Cronjob-to-autobackup-database-tp5734873p5735088.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
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Cronjob to autobackup database
@ 2012-12-05 06:32 arunpadule@gmail.com <arunpadule@gmail.com>
parent: teyking2003 <tchongking@hotmail.com>
1 sibling, 0 replies; 8+ messages in thread
From: arunpadule@gmail.com @ 2012-12-05 06:32 UTC (permalink / raw)
To: pgsql-admin
Try by below method:
30 09 * * * sh /autopgdump.sh
These should work.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Cronjob-to-autobackup-database-tp5734873p5735118.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
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Cronjob to autobackup database
@ 2012-12-05 13:35 Spike Grobstein <spike@ticketevolution.com>
parent: teyking2003 <tchongking@hotmail.com>
1 sibling, 0 replies; 8+ messages in thread
From: Spike Grobstein @ 2012-12-05 13:35 UTC (permalink / raw)
To: teyking2003 <tchongking@hotmail.com>; +Cc: pgsql-admin
Ahh. When you said "root" I thought you meant "/". Yes, if in /root, then /root/autopgdump.sh
You must specify absolute path in cron.
...spike
(Sent via handheld, please pardon spelling errors)
On Dec 4, 2012, at 7:48 PM, teyking2003 <tchongking@hotmail.com> wrote:
> so if i putting the .SH files under root directory
> the cronjob will look similar like
> 30 09 * * * /root/autopgdump.sh
>
> please advice?
>
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/Cronjob-to-autobackup-database-tp5734873p5735088.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
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Cronjob to autobackup database
@ 2012-12-06 00:39 teyking2003 <tchongking@hotmail.com>
parent: teyking2003 <tchongking@hotmail.com>
2 siblings, 1 reply; 8+ messages in thread
From: teyking2003 @ 2012-12-06 00:39 UTC (permalink / raw)
To: pgsql-admin
i copy this copy inside etc/cron.daily/autopgdump.sh and put in the full
directory path and wait until 930am. but nothing has been process.
do we need to setup special permission for this .SH file?
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Cronjob-to-autobackup-database-tp5734873p5735397.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
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Cronjob to autobackup database
@ 2012-12-06 03:26 Greg Williamson <gwilliamson39@yahoo.com>
parent: teyking2003 <tchongking@hotmail.com>
0 siblings, 0 replies; 8+ messages in thread
From: Greg Williamson @ 2012-12-06 03:26 UTC (permalink / raw)
To: pgsql-admin
A question --
>________________________________
> From: teyking2003 <tchongking@hotmail.com>
>To: pgsql-admin@postgresql.org
>Sent: Wednesday, December 5, 2012 4:39 PM
>Subject: Re: [ADMIN] Cronjob to autobackup database
>
>i copy this copy inside etc/cron.daily/autopgdump.sh and put in the full
>directory path and wait until 930am. but nothing has been process.
>
>do we need to setup special permission for this .SH file?
>
If you copy the command exactly as the cron entry shows it, and, as the user who runs the cron job, paste it onto the command line and run it; what does the command do ?
If it runs from the command line, a few possibilities occur to me --
a) you didn't set the time to what you thought you did (been there, done that, easy to do).
b) Some missing part that the user's environment is providing (an ENV var, for example) but the cron job would not know about.
If it does not run from the command line, that will probably give you a clue.
HTH,
Greg Williamson
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2012-12-06 03:26 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-12-04 01:13 Cronjob to autobackup database teyking2003 <tchongking@hotmail.com>
2012-12-04 14:35 ` Krawetzky, Peter J <KrawetzkyPJ@aetna.com>
2012-12-05 00:48 ` teyking2003 <tchongking@hotmail.com>
2012-12-05 06:32 ` arunpadule@gmail.com <arunpadule@gmail.com>
2012-12-05 13:35 ` Spike Grobstein <spike@ticketevolution.com>
2012-12-04 14:51 ` Spike Grobstein <spike@ticketevolution.com>
2012-12-06 00:39 ` teyking2003 <tchongking@hotmail.com>
2012-12-06 03:26 ` Greg Williamson <gwilliamson39@yahoo.com>
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