[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[LDM #HNN-995230]: running pqinsert in shell scripts
- Subject: [LDM #HNN-995230]: running pqinsert in shell scripts
- Date: Wed, 14 Sep 2016 09:53:57 -0600
Carol,
In general, crontab(1)-executed processes don't have the same environment as if
they were executed manually from a login user shell. The solution is to have
the crontab(1) entry explicitly source the login environment, e.g.,
0 0 * * * bash -l -c 'ldmadmin newlog'
The "-l" option causes bash(1) to source the login environment, which adds the
directory "~/bin" to the PATH environment variable so that ldmadmin(1) is found.
> Yesterday I made a new shell script that does some unix commands in
> order to create a new fancy text file. At the end of the script I have a
> pqinsert command that puts the file into the ldm queue.
>
> When I manually run the script as user ldm everything works fine and the
> text file is inserted into the queue. When the script is run
> automatically through ldm's cron job it gives me the following error
>
> /home/ldm/freewave/getFRWfile.sh: line 56: pqinsert: command not found
>
> 56 pqinsert -v -q /home/ldm/var/queues/ldm.pq -f EXP -p
> ANT.AMRC.AWSrecent.txt $FRWPATH/AWSrecent.txt >> $logfile 2>&1
>
> I'm not sure what could be going on here when the script is run
> automatically versus manually. Is there an ldm environment that needs to
> be set at the beginning of the script?
>
> Let me know if you would need more details.
Regards,
Steve Emmerson
Ticket Details
===================
Ticket ID: HNN-995230
Department: Support LDM
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata
inquiry tracking system and then made publicly available through the web. If
you do not want to have your interactions made available in this way, you must
let us know in each email you send to us.