PxPlus User Forum

Twitter Twitter Twitter

Author Topic: INPUT in a cron job  (Read 118 times)

John_S

  • Member
  • **
  • Posts: 13
    • View Profile
INPUT in a cron job
« on: December 04, 2019, 02:03:13 PM »
Hello.

We run numerous PxPlus cron jobs on our RedHat server, and many of those programs can also be run on-demand in a regular session. Some of these programs have INPUT statements, and while we try to program them to skip INPUT statements when the user is "batch", we sometimes miss some of them.  This causes the cron process to hang, and it even appears to slow the system down.

Is there a system parameter that would issue a RELEASE if an INPUT statement is encountered in a cron job?  I figure the answer is No, and I don't even know how it would know it is a cron job, but my associate wanted me to post the question.

PxPlus 14.10.

Thanks!

ksproul

  • Silver Member
  • ***
  • Posts: 21
    • View Profile
Re: INPUT in a cron job
« Reply #1 on: December 04, 2019, 04:49:48 PM »
I believe a background process will quit when it hits an input statement if there is no "input" file/device associated with it.  If you are not redirecting input to /dev/null (i.e. < /dev/null), see if that helps.
Ken Sproul
DPI Information Services, Inc.

John_S

  • Member
  • **
  • Posts: 13
    • View Profile
Re: INPUT in a cron job
« Reply #2 on: December 04, 2019, 04:58:58 PM »
Thanks Ken.  I will pass this on to my associate.

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3197
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: INPUT in a cron job
« Reply #3 on: December 04, 2019, 05:22:55 PM »
Ken is correct. 

When running in background you should redirect terminal input to something like </dev/null and your application will need to deal with an END-OF-FILE error should it attempt to read from channel 0. 

If desired you can redirect input from a file which has pre-determined responses -- but I doubt that is what you want or need.

John_S

  • Member
  • **
  • Posts: 13
    • View Profile
Re: INPUT in a cron job
« Reply #4 on: December 04, 2019, 05:29:46 PM »
Thanks Mike!