Home
Man
Search
Today's Posts
Register

Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

crontab is not working!!

Login to Reply

 
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.!!!!!!!!!!!!

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
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
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
Script not working via crontab ash1234 Shell Programming and Scripting 1 02-09-2015 06:32 AM
Script not working via crontab ash12345 Shell Programming and Scripting 6 02-08-2015 01:34 PM
Crontab not working krebe Linux 4 02-12-2013 05:50 AM
Script not working in crontab nandan8a Shell Programming and Scripting 9 08-08-2012 09:22 PM
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 not working rajesh_hv UNIX for Advanced & Expert Users 4 10-28-2008 08:45 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


All times are GMT -4. The time now is 11:59 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password