Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I created a script which takes the IP configuration as input

ifconfig | /usr/bin/python "/home/michel/Python/sendIp.py"

When i type that in in the command prompt, the script gets executed well, and the result of the ifconfig script is available in my script.

However, when I insert it in my cron (with crontab -e) like this, it does not read the ifconfig input

* * * * * ifconfig | /usr/bin/python "/home/michel/Python/sendIp.py"

The input is read in the script like this: data = sys.stdin.read()

share|improve this question

marked as duplicate by Aaron Copley, mgorven, Ward, mdpc, Khaled Feb 23 '13 at 8:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Well, as i new user on these kind of things, the 'possible' duplicate list didn't help me much. I was more helped by Jasons answer – Michel Feb 22 '13 at 21:23
up vote 1 down vote accepted

Try using the full path to ifconfig in your cronjob.

[~]: which ifconfig
/sbin/ifconfig
share|improve this answer
1  
Wicked, that works! – Michel Feb 22 '13 at 20:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.