Re: Freebsd + cron job +perl script



On 11/29/07, FRANCIS PROVENCHER

I'v add a perl script in my crontab (To execute with root rigth)

Root rights? Well, if you must.

If i execute the perl script in command line, all work fine.

If the problem only shows up under cron, the environment is different
under cron. The current working directory, environment variables, and
other things may be different. Your program, it seems, makes some
mistaken assumption about the environment. Maybe it stops to ask the
user for input, for example; but that won't work under cron.

Somebody will have to look at the source to see what environmental
assumption it contains. Did you think we could debug your program
without even seeing it?

Cheers!

--Tom Phoenix
Stonehenge Perl Training
.



Relevant Pages

  • Re: System Time, where does it come from?
    ... it would be perfectly understandable if the hardware time was set to ... Simply looking in the cron log ... The crontab -l command was executed from your shell, ... environment or your cron daemon's environment that disagrees about ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Cron question
    ... You can test things by doing an "su gs -c /bin/sh" from a root login and then trying to run your wrapper, which will give you a minimum environment closer to what cron executes under. ... SVN_EDITOR => vim ...
    (freebsd-questions)
  • Re: Cron ?
    ... Normally bash is interactive environment. ... But cron is not. ... By default cron does not create an user environment. ... You do not need to redirect the output, it will be mailed to the user owning the crontab. ...
    (linux.redhat)
  • Re: Periodic maintenance task will not send mail
    ... cron has it's own environment; if you want to use yours ... you have to read it in specifically, or set it in your crontab. ... the periodic tasks are not running under cron ...
    (comp.sys.mac.system)
  • Re: Cron ?
    ... Normally bash is interactive environment. ... But cron is not. ... By default cron does not create an user environment. ...
    (linux.redhat)