pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mohamed ebrahim <mohdebrahim@yahoo.com>
To: jconway2@home.com
To: pgsql-sql@postgresql.org
Subject: Help
Date: Sun, 25 Mar 2001 23:36:31 -0800 (PST)
Message-ID: <20010326073631.8754.qmail@web1002.mail.yahoo.com> (raw)
In-Reply-To: <00eb01c0b568$7caf3fa0$0205a8c0@jecw2k1>

Hi, 

  Thanks for your valuable information. I tried the
cron. i typed
   cron -e
and entereed into the input area. but i don't know how
to save the cron file. I pressed ctrl+z and came out
from cron. but i edit the cron file i found nothing on
it.(i.e using pico filename.) Please tell me some
description how to save the file in cron and to achive
this. I will be thankful to you.

Ebrahim

>     I am a user postgresql. I want to update a table
> automatically when we reach monthend. i.e i want to
> update some table on 31 of every month automatically
> without any user attention. I want to know how to do
> this. If anyone knows how to do this please mail me.
>i
> will be ever thankfull to him.



>Joe wrote:
>
>Probably the easiest way to do this is to write a
>script and run it 
>from
>cron. For example, if your update query is in a file
>called
>$HOME/bin/monthend.sql:
>
>    insert into mymonthendtable(f1, f2, f3)
>values(123,'03/31/2001',12345.67);
>
>your script (call it $HOME/bin/monthend.sh) might
>look like:
>
>    #!/bin/sh
>    psql -U postgres mydatabasename <
>$HOME/bin/monthend.sql
>
>then run (see "man 5 crontab" for more on cron)
>    crontab -e
>
>and add an entry like
>
>    # run at 2:15 AM on the 30th of every month
>    15 2 30 * *     $HOME/bin/monthend.sh
>
>Hope this helps,
>
>Joe
>

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



view thread (36+ messages)  latest in thread

Message-ID: <20010326073631.8754.qmail@web1002.mail.yahoo.com>
Permalink:  ../20010326073631.8754.qmail@web1002.mail.yahoo.com/
Also on:    postgresql.org/message-id/20010326073631.8754.qmail@web1002.mail.yahoo.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-sql@postgresql.org
  Cc: mohdebrahim@yahoo.com, jconway2@home.com
  Subject: Re: Help
  In-Reply-To: <20010326073631.8754.qmail@web1002.mail.yahoo.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