LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-07-2009, 08:08 AM   #1
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Rep: Reputation: 30
cron is ignoring lines...


My current crontab looks like:

[root@sda03 ~]# crontab -l
0 0,8,16 * * * /opt/CMTSCheck/bin/GrabCMData.sh
37 * * * * /opt/CMTSCheck/bin/RegStateUpdate.sh
1 1 * * * /opt/CMTSCheck/bin/DropOldTables.sh

For some reason, the only thing that will execute is the middle line... Any idea why?

[root@sda03 ~]# grep GrabCMData /var/log/cron | wc -l
0
[root@sda03 ~]# grep DropOldTables /var/log/cron | wc -l
0

This is on a RH5.1 system with crontabs-1.10-8 installed.

Am I doing something wrong?
 
Old 04-07-2009, 01:04 PM   #2
synss
Member
 
Registered: Jul 2007
Location: Germany
Distribution: Debian, Gentoo, Mac OS X
Posts: 137

Rep: Reputation: 22
Are all of them executable? Check with ls -l.
 
Old 04-07-2009, 02:01 PM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Any message in the mail box of the crontab's owner?
 
Old 04-09-2009, 05:27 AM   #4
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Original Poster
Rep: Reputation: 30
Yes, they are all executable, and exist. There are no messages in the crontabs mailbox...

[root@sda03 ~]# ls -lah /opt/CMTSCheck/bin/GrabCMData.sh
-rwxr-xr-x 1 501 20 1.2K Apr 6 13:51 /opt/CMTSCheck/bin/GrabCMData.sh
[root@sda03 ~]# ls -lah /opt/CMTSCheck/bin/RegStateUpdate.sh
-rwxr-xr-x 1 501 20 1.8K Mar 31 22:00 /opt/CMTSCheck/bin/RegStateUpdate.sh
[root@sda03 ~]# ls -lah /opt/CMTSCheck/bin/DropOldTables.sh
-rwxr-xr-x 1 root root 524 Mar 30 15:41 /opt/CMTSCheck/bin/DropOldTables.sh
 
Old 04-09-2009, 05:35 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
What about redirecting standard output and standard error to a file? Put the current date in the filename so that you know when the file has been created and if the cron job has run at the proper time:
Code:
0 0,8,16 * * * /opt/CMTSCheck/bin/GrabCMData.sh > /opt/$(date +\%Y\%m\%d\%H\%M)_GrabCMData.log 2>&1
37 * * * * /opt/CMTSCheck/bin/RegStateUpdate.sh > /opt/$(date +\%Y\%m\%d\%H\%M)_RegStateUpdate.log 2>&1
1 1 * * * /opt/CMTSCheck/bin/DropOldTables.sh > /opt/$(date +\%Y\%m\%d\%H\%M)_DropOldTables.log 2>&1
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
diff / patch ignoring changes to particular lines Kikazaru Linux - General 2 03-09-2009 10:57 AM
AWK- processing data inside start/stop pairs but ignoring start/stop lines cliffoij Programming 2 10-15-2008 06:17 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration