crontab is not working!!

 
Thread Tools Search this Thread
# 1  
Old 09-07-2011
crontab is not working!!

I can run manually script of ntopdump.sh but crontab can't run this script very five minutes.
Code:
# crontab -l
*/3 * * * * root sh /root/ping.sh
*/5 * * * * root sh /root/ntopdump.sh
#

Code:
# pwd
/root
# ls -l
total 88
-rwxrwxr-x 1 root root  1645 Jun 14 19:01 anaconda-ks.cfg
drwxrwxr-x 2 root root  4096 Jun 14 16:05 Desktop
-rwxrwxr-x 1 root root 42604 Jun 14 19:01 install.log
-rwxrwxr-x 1 root root  5077 Jun 14 19:00 install.log.syslog
-rw-r--r-- 1 root root    14 Aug 26 17:20 IPADDR.txt
-rwx--x--x 1 root root   102 Aug 26 17:20 ntopdump.sh
-rwx--x--x 1 root root    53 Aug 26 17:20 ping.sh
#

Code:
# cat ntopdump.sh 
wget -O ntop-$(date +%Y%m%d_%H:%M).php "http://127.0.0.1:3000/dumpData.html?language=php&view=short"
#

# 2  
Old 09-07-2011
what is your crontab log says ?

check in /var/log/
# 3  
Old 09-07-2011
Everthing seems fine ? isn't it? Time priod is right. There is no error messages.
I added !/bin/bash first line of this script but reason didn't change.

Code:
# tail -f  /var/log/cron
Sep  7 13:20:01 argela crond[17306]: (root) CMD (root sh /root/ntopdump.sh)
Sep  7 13:21:01 argela crond[17314]: (root) CMD (root sh /root/ping.sh)
Sep  7 13:24:01 argela crond[17324]: (root) CMD (root sh /root/ping.sh)
Sep  7 13:25:01 argela crond[17332]: (root) CMD (root sh /root/ntopdump.sh)
Sep  7 13:25:39 argela crontab[17339]: (root) LIST (root)
Sep  7 13:27:01 argela crond[17347]: (root) CMD (root sh /root/ping.sh)
Sep  7 13:30:01 argela crond[17358]: (root) CMD (root sh /root/ntopdump.sh)
Sep  7 13:30:01 argela crond[17359]: (root) CMD (root sh /root/ping.sh)
Sep  7 13:33:01 argela crond[17396]: (root) CMD (root sh /root/ping.sh)
Sep  7 13:35:01 argela crond[17441]: (root) CMD (root sh /root/ntopdump.sh)

What is the main problem.!!!!!!!!!!!! Smilie

Code:
# cat ntopdump.sh 
!/bin/bash
wget -O ntop-$(date +%Y%m%d_%H:%M).php "http://127.0.0.1:3000/dumpData.html?language=php&view=short"
#

# 4  
Old 09-07-2011
Code:
#!/bin/bash

# 5  
Old 09-07-2011
Is this typo ?

!/bin/bash -- Missing #
# 6  
Old 09-07-2011
My friends, script isn't working on crontab but it is working manually.

Everythink seems fine but what is the problem!
# 7  
Old 09-07-2011
If it isn't the missing # at the start of the shebang line then it could be that wget isn't on crontab's path.
try substituting the full path to the wget binary

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Crontab is not working BPANDEY Red Hat 5 09-17-2015 11:55 AM
Crontab not working Junaid Subhani Shell Programming and Scripting 7 06-06-2015 04:02 PM
Crontab not working krebe Linux 4 02-12-2013 05:50 AM
Crontab not working, please help samantha13 UNIX for Advanced & Expert Users 0 08-02-2012 01:25 PM
crontab not working isaacniu Solaris 6 01-09-2012 06:41 PM
crontab not working shifahim UNIX for Dummies Questions & Answers 8 08-16-2011 09:22 AM
crontab is not working. getrue Solaris 6 07-27-2011 01:34 AM
crontab not working lg123 UNIX for Dummies Questions & Answers 2 04-24-2011 04:47 PM
Crontab entry is not working jramesh1 UNIX for Dummies Questions & Answers 1 07-27-2010 05:07 AM
Crontab and working directory manustone Shell Programming and Scripting 2 02-05-2010 09:20 AM
crontab not working rajesh_hv UNIX for Advanced & Expert Users 4 10-28-2008 08:45 AM
crontab-nmon not working fara_aris AIX 5 06-03-2008 06:08 AM
crontab NOT working baanprog UNIX for Advanced & Expert Users 2 09-26-2006 01:11 PM
crontab not working right kymberm UNIX for Dummies Questions & Answers 3 07-09-2003 05:21 PM
cron/crontab not working ezekiel61 UNIX for Dummies Questions & Answers 2 02-05-2003 07:59 AM