Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Calling System Service command fails in cronjob

by blue_cowdawg (Monsignor)
on Aug 13, 2012 at 19:42 UTC ( [id://987193]=note: print w/replies, xml ) Need Help??


in reply to Calling System Service command fails in cronjob

      The error I get from this outputting in the cronjob is as follows: Can't exec "service": No such file or directory So the question is, why is the command "service" not working in cronjob but works manually.

Never make assumptions. I noticed right off as someone else did that you did not specify the path to your command. The PATH variable you see from the command line is likely to be different than what a cronjob is going to see. There are a couple of ways you can cure this:

  1. You could specify the full path name to the command you are trying to invoke from system
  2. Add a fully populated PATH to your crontab. Warning be careful of what directories you add to your PATH from within your crontab. This could lead to a security hole so be sure of what you are doing.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Replies are listed 'Best First'.
Re^2: Calling System Service command fails in cronjob
by omegaweaponZ (Beadle) on Aug 13, 2012 at 20:55 UTC
    Good call, that was the issue. Need a full path always to crontab's. Thanks! This issue is now resolved

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://987193]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-28 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found