It is currently Tue, 17 May 2022 01:31:13 GMT



 
Author Message
 Incomplete output from crontab email: running shell scripts from a perl script
I am running a perl script from my crontab.  The perl script that I
run executes shell scripts at the command line.  My crontab sends me
the output from this perl script that runs shell scripts.  However, if
I run the shell scripts directly from the crontab itself I get a
different output (the output that I want).

Why would a perl script that runs a shell script give me a different
"cron job" output then the shell script itself?

I don't think it is a perl problem but I am running the shell scripts
from perl with the following command: `$shell_script`.

Any help would be greatly appreciated.



 Mon, 12 Jan 2004 04:51:48 GMT   
 Incomplete output from crontab email: running shell scripts from a perl script

jobs executed by cron can have a different environment than the same
job executed in an interactive shell:

  + different $PATH
  + different current working directory
  + different shell (cron executes its jobs with sh.  is sh your shell?)

---
"... What with you being his parents and all, I think that you could
be trusted not to shaft him."  -- Robert Chang, rec.games.board

John Gordon                               gor...@osiris.cso.uiuc.edu



 Mon, 12 Jan 2004 04:56:27 GMT   
 Incomplete output from crontab email: running shell scripts from a perl script
On 25 Jul 2001, tenpercenter <tenpercente...@hotmail.com> wrote:

That assigns the STDOUT of the script to $_ unless you assign it to a
variable and/or print that at some point.  Does it work like you expect if
you do:  print `shell_script`; [or maybe you want to use system()]?

--
David Efflandt  (Reply-To is valid)  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/



 Mon, 12 Jan 2004 11:20:33 GMT   
 Incomplete output from crontab email: running shell scripts from a perl script

Also:

  + no controlling terminal [tty or pty or whatever].
  + current uid, gid, and euid may be different (not sure on this).

The lack of a terminal is unlikely to cause problems, but you may have
permissions problems.  This would be similar to when a program is called
via CGI.

--
I need more taglines. This one is getting old.



 Thu, 15 Jan 2004 04:00:47 GMT   
 
   [ 4 post ] 

Similar Threads

1. Error starting CDE when shell script is run via crontab in VNC

2. shell-script executes a perl-script???

3. PERL script vs SHELL script


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software