Re: Cron ?



Terry A Haimann wrote:
No standard input is required. It is accepting a parm from the command
line. I suspect the programs problem is with gpg, which it uses to
unencrypt a file. I think gpg needs a environment variable and that what
is getting me into trouble.

On Mon, 27 Aug 2007 19:37:58 +0200, Jan Gerrit Kootstra wrote:


Terry A Haimann wrote:

I tried the following:

0 0 * * * /bin/su - MyUser -c /path/your-FreePascal-program

And when it ran I got the following message:

standard in must be a tty

On Wed, 22 Aug 2007 21:24:05 +0200, Jan Gerrit Kootstra wrote:



Terry A Haimann wrote:


Is there something different about running a job in cron then there is

from a command prompt. I have a FreePascal created program that crashes

when I run it from cron, but works normally when submitted from bash. This program is starting several other programs (If that makes any
difference.)

Thx, Terry

Terry,


Does your program require environment variables to be set before running the program itself?

By default cron does not create an user environment.

To set an user environment I use a script,say cron-pascal-program.sh with a content like:

su - user -c /path/your-FreePascal-program


and the cron entry like:

0 0 * * * /path-to/cron-pascal-program.sh


Other option, I have not tested: cron entry

0 0 * * * /bin/su - user -c /path/your-FreePascal-program

This way your user environment is set at runtime of the Pascal program.


Best regards,


Jan Gerrit Kootstra


Terry,


Does this program need standard input? In other words do you need to answer questions bt typing words or numbers?

So can you give more details about what your program is doing?


Kind regards,


Jan Gerrit Kootstra


Terry,


You can put the parm on the line too. Just like on commandline. Seperate commands by semicolons (;).

If you need more help, then show us the commandline you use in an interactive shell session.


Kind regards,


Jan Gerrit Kootstra
.



Relevant Pages

  • Re: Compiling Webkit-Glib and PyWebkitGTK for Win32
    ... terry, hi: ... instructions to ensure that you have the right build environment for ... windows is here: ...
    (comp.lang.python)
  • Exch2k3 SP1
    ... Anyone installed exchange 2003 service pack 1 in a production ... Any caveats and/or tips / suggestions? ...
    (microsoft.public.exchange.admin)
  • Re: ENV variable NOT recognized ! Reboot really necessary ????
    ... this will only change the environment block for new processes created *after* the change. ... Existing processes will keep on using their current environment block, which is the same as it was before you made the change. ... But an application needs to be written to explicitly do this; there's no mechanism in the operating system to universally update environment variables on the fly for running processes. ... For example, say you had a command prompt open, and you run a SET command to display the current variables. ...
    (microsoft.public.windowsxp.help_and_support)
  • [REVS] Using Environment for Returning Into Lib C
    ... This article explains how to use the environment variables to successfully ... The environment will consequently be used to store it. ... It is easy to write a simple program to put the command directly into the ... declare -x COLORTERM="" ...
    (Securiteam)
  • Re: SSH environment variable passing
    ... has to be a capability of both the client and the server. ... to support only a couple of specific environment variables. ... I have been told that allowing unlimited environment variables to be set ... A parallel situation exists in telnet. ...
    (SSH)