| From: | Oliver Elphick <olly(at)lfix(dot)co(dot)uk> |
|---|---|
| To: | sigridmeneses(at)gmail(dot)com |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: QUERY A PSQL DB USING CRONTAB |
| Date: | 2005-09-21 13:18:31 |
| Message-ID: | 1127308711.22314.12.camel@localhost.localdomain |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
On Wed, 2005-09-21 at 06:20 -0500, Sigrid Meneses wrote:
> ... when i add mi script to the crontab, it genrates a file with 0
> Kb , i dont know why can you help me?
>
> FECH=`/bin/date +%Y%m%d`
> #Se hace la busqueda en la base de datos
> cd /home/swuser/MDNIMSI
> psql oampwms_4_1_0_0 -c "select
> whlr_subscriber_profile.subscriber_id,whlr_mdn.m
> dn from whlr_subscriber_profile,whlr_mdn where whlr_mdn.id =
> whlr_subscriber_pro
> file.mdn;" > pttsubs$FECH.txt
>
...
>
> -rw-rw-r-- 1 swuser swuser 0 Sep 16 00:30
> pttsubs050916.txt
You probably need to set PATH in the script to include where to find
psql, or else use the full path in the psql command. Cron only has a
very restricted path set for it.
Oliver Elphick
| From | Date | Subject | |
|---|---|---|---|
| Next Message | A. Banks | 2005-09-22 00:46:10 | Primary and Foreign Key? |
| Previous Message | Sigrid Meneses | 2005-09-21 11:20:37 | QUERY A PSQL DB USING CRONTAB |