CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [dzordzyk] Executing script from cron.d: Edit Log



FishMonger
Veteran / Moderator

Mar 13, 2010, 4:41 PM


Views: 8212
Re: [dzordzyk] Executing script from cron.d

So, the script is actually being executed, but the backticks command is failing, is that correct?

If so then the problem is a difference in the environment. In this case it's the path environment. This is one of the main reasons you should provide full paths when shelling out.

change:

Code
$ps_output = `ps ax | grep "$service" | grep -v $0 | grep -v grep`;


to:

Code
$ps_output = `/bin/ps ax | /bin/grep "$service" | /bin/grep -v $0 | /bin/grep -v grep`;

adjust the path as needed


(This post was edited by FishMonger on Mar 13, 2010, 4:44 PM)


Edit Log:
Post edited by FishMonger (Veteran) on Mar 13, 2010, 4:44 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives