cron task not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cron task not working
# 1  
Old 08-05-2004
cron task not working

This command works from the command line but as a cron task it won't do the "ifconfig" part.
Code:
echo `date "+20%y-%m-%d% %H:%M:%S"` `ifconfig en0 | grep "inet " | awk '{print $2}'` >> /tmp/mysqlip.txt

If I put it in root's crontab it doesn't do anything. Any ideas or advice would be greatly appreciated. - James

Last edited by cassj; 08-05-2004 at 03:18 PM..
# 2  
Old 08-05-2004
try:
Code:
echo `date "+20%y-%m-%d% %H:%M:%S"` `/usr/sbin/ifconfig en0 | grep "inet " | awk '{print $2}'` >> /tmp/mysqlip.txt 2>path/to/errorfile.log

add the path to ifconfig, and then add the redirection to a log
file to see if you have any other problems. You may also have to specify paths for grep, etc - any command that is not a shell built-in.
# 3  
Old 08-05-2004
Thanks, Jim. That did it! I just included the path for "ifconfig". I'm a bonehead. -James
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SuSE

Cron not working

Hi, It is SLES 10.3 VM. Suddenly cron stopped working on this and I am not able to figure out, where it is failing. It is not running with even root. I gave a simple job of redirection of 'date' command, that also doesn't work. Can somebody help me to fix this ? vmprdt23:~ # ps -ef | grep -i... (4 Replies)
Discussion started by: solaris_1977
4 Replies

2. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

3. Shell Programming and Scripting

Script is not working from cron while working manually

Hello, I am facing a very strange problem when I run my script manuallu ./Fetchcode which is using to connect with MKS integrity from linux end it workks fine but when I run it from cron it doesn't work.Can someone help me 1) How could I check my script when it is running from cron like... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies

4. Ubuntu

cron-tab issue(Task scheduling)

I used the cron-tab to run the rails's server 24 hours for my application by issuing the following command in terminal crontab -3(To open the cron-tab terminal) and then * * * * * OSV/OpenStreetView/script/server Similarly i tried to run server for the django application by issuing the... (2 Replies)
Discussion started by: amritpalpathak
2 Replies

5. Red Hat

Cron task output is 0, script output is OK

I have the following cron task set to run every 15 minutes to ascertain how many users are in the system and append the result to the log. /home/pronto/cus/whoisinc >> /home/pronto/cus/whoisin.log This is the whoisinc script date +"%d-%m-%Y,%k:%M,Pronto Users,`prowho -s | grep -v... (1 Reply)
Discussion started by: scottm
1 Replies

6. Solaris

cron not working.

I have a script monitor.sh the path is /netmon/bin/monitor.sh when i run this script as sh /netmon/bin/monitor.sh it runs completely fine. but when i include it in crontab , it does not run my cron entry is 0,5,10,15,20,25,30,35,40,45,50,55 * * * *... (11 Replies)
Discussion started by: asalman.qazi
11 Replies

7. Shell Programming and Scripting

comment and Uncomment single task out of multiple task

I have a file contains TASK gsnmpproxy { CommandLine = $SMCHOME/bin/gsnmpProxy.exe } TASK gsnmpdbgui { CommandLine = $SMCHOME/bin/gsnmpdbgui.exe I would like to comment and than uncomment specific task eg TASK gsnmpproxy Pls suggest how to do in shell script (9 Replies)
Discussion started by: madhusmita
9 Replies

8. UNIX for Dummies Questions & Answers

Cron not working

I created a file in /u01/oradata directory as cronjb.ksh which contains following script 30 12 * * * /export/home/oracle/u01/oradata/rman.ksh '/export/home/oracle' is my root directory. I then moved cronjb.ksh file to my '/export/home/oracle' directory. i typed crontab cronjb.ksh. However my... (1 Reply)
Discussion started by: manna
1 Replies

9. UNIX for Dummies Questions & Answers

Cron not working?

Hello I have a mac os x server machine that I have setup a cron to run a php file using wget and cron doesn't seem to work. I have setup cron on other mac's before and they have all worked. Also I know wget works because I have tested it. Is there anything else I should try? I do crontab -e and... (5 Replies)
Discussion started by: christo16
5 Replies

10. UNIX for Dummies Questions & Answers

cron not working

Cron does not seem to work with this crontab. Any ideas? # run-parts # commands to execute every hour 01 * * * * root run-parts /etc/cron.hourly # commands to execute every day 02 4 * * * root run-parts /etc/cron.daily # commands to execute every week 22 4 * * 0 root run-parts... (1 Reply)
Discussion started by: DaleCabell
1 Replies
Login or Register to Ask a Question