root crontab wont execute a script

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat root crontab wont execute a script
# 1  
Old 10-18-2012
root crontab wont execute a script

Greetings/

I have a script listed in my roots crontab

Code:
07 9 * * * /opt/HLRSDATA_2010_OCT/HLRS_Scheduler_sp.sh > /opt/HLRSDATA_2010_OCT/logs/HLRTKJob.log

This script contains the following

Code:
#!/bin/bash
echo HLRSData Scheduler
cd /opt/HLRSDATA_2010_OCT
/usr/bin/java -Xms32m -Xmx1024m -cp ".:HLRSDATA_Premium.jar:lib/commons-net-1.4.1.jar:lib/jakarta-oro-2.0.8.jar:lib/mysql-connector-java-3.1.12-bin.jar:lib/x
ercesImpl.jar" mx.com.txm.hlrsdata.scheduler.HLRS_Scheduler

/opt/HLRSDATA_2010_OCT/HLRS_Scheduler_Reports_sp.sh

/opt/HLRSDATA_2010_OCT/HLRS_Scheduler_Reports_Redundant_sp.sh
/opt/HLRSDATA_2010_OCT/HLRS_Delete_Data_sp.sh
/opt/HLRSDATA_2010_OCT/HLRS_Delete_Data_Redundant_sp.sh
/opt/HLRSDATA_2010_OCT/HLRS_Delete_Files.sh

The script is not running, I checked in /var/log/cron and theres not even a trace that it at least TRIED to run something.

Log:
Code:
Oct 18 08:47:19 isvahlrtk01 crontab[46449]: (root) END EDIT (root)
Oct 18 08:47:22 isvahlrtk01 crontab[46455]: (root) BEGIN EDIT (root)
Oct 18 08:47:35 isvahlrtk01 crontab[46455]: (root) REPLACE (root)
Oct 18 08:47:35 isvahlrtk01 crontab[46455]: (root) END EDIT (root)
Oct 18 08:57:18 isvahlrtk01 crontab[46540]: (root) LIST (root)
Oct 18 09:00:18 isvahlrtk01 crontab[46548]: (root) LIST (root)
Oct 18 09:04:24 isvahlrtk01 crontab[46563]: (root) BEGIN EDIT (root)
Oct 18 09:04:37 isvahlrtk01 crontab[46563]: (root) REPLACE (root)
Oct 18 09:04:37 isvahlrtk01 crontab[46563]: (root) END EDIT (root)
Oct 18 09:07:46 isvahlrtk01 crontab[46578]: (root) LIST (root)

Theres a newline at the end of my crontab, theres no /etc/crontab.allow.

What could be preventing this to be executed?

Thanks in advance

Last edited by RedSpyder; 10-18-2012 at 10:36 AM..
# 2  
Old 10-18-2012
This might be a long shot... but do you have SELinux enabled? Check with sestatus.
# 3  
Old 10-18-2012
sestatus:
Code:
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

# 4  
Old 10-18-2012
So it is enabled. If you don't need it, then disable it temporarily with setenforce 0, then try running your cron job again.
# 5  
Old 10-18-2012
Did it... changed the job for 9:59 and nothing, nothing in /var/log/cron
# 6  
Old 10-18-2012
Maybe something in /var/spool/mail/root? Check:
Code:
tail -50 /var/spool/mail/root

# 7  
Old 10-18-2012
Code:
 tail: cannot open `/var/spool/mail/root' for reading: No such file or directory

---------- Post updated at 09:58 AM ---------- Previous update was at 09:44 AM ----------

..........................crontab service was stopped...........................
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crontab scheduler to execute script every 45 days

Can someone please help me on how to schedule script to run every 45 days in crontab ? Thanks, Prince (5 Replies)
Discussion started by: prince1987
5 Replies

2. Shell Programming and Scripting

Startup script wont execute on NAS

Hi, So I've created /etc/rc.local #!/bin/sh polipo -c /opt/etc/polipo/polipo.conf exit 0 if I run it with ./rc.local it does what its supposed to do and the proxy starts but not at startup. any idea whats wrong? thanks (1 Reply)
Discussion started by: deon
1 Replies

3. Shell Programming and Scripting

Crontab does not execute script within a script

Hello All, I have a crontab schedule and its executing a script that is calling another script and does not execute. Crontab : ***** /test.sh and in test.sh /usr/local/file.sh and in file.sh webproxy -l 192.168.1.151 But when I run the script (test.sh) directly it works. But using... (1 Reply)
Discussion started by: Shaan_Shaan
1 Replies

4. Shell Programming and Scripting

Shell script wont execute

Im using a script that writes a random line to a text file then executes another shell script. My problem is that the lottery shell script will not execute. Im not receiving an errors when running the shell script, and it copies a random line of text to mtest.txt fine. #!/bin/bash nscripts=2... (3 Replies)
Discussion started by: kylecn
3 Replies

5. Shell Programming and Scripting

MKS KORN SHELL WONT EXECUTE from windows command prompt

Can anybody help me with this small script , the script works fine and launches the IE from c:\documents and settings \test\my documents>ksh prompt $RunURL1.sh this scitpt works and launches the ie from ksh , but when i schedule it to run the script then i get the error box saying command:1... (2 Replies)
Discussion started by: venu
2 Replies

6. Shell Programming and Scripting

login into root from user and execute command through script

i have logged in as user. I want to write a script to login into root and execute commands for eg. ifconfig or other command. kindly help me out. (6 Replies)
Discussion started by: pradeepreddy
6 Replies

7. UNIX for Dummies Questions & Answers

Crontab works but does not execute script

Hi guys, my first post time here, so hello to everyone :) I've got a problem running one of my scripts at work. I can get crontab working on simple scripts (i.e. one that just outputs date to a temp file). but it won't correctly execute the script i want to use. My script is a PHP script. It... (6 Replies)
Discussion started by: renegadeice
6 Replies

8. UNIX for Dummies Questions & Answers

file wont execute

sh filename and it gives me an error saying the file doesnt exist but it definately does. (4 Replies)
Discussion started by: iago
4 Replies

9. UNIX for Dummies Questions & Answers

how to execute sh script in bash shell via crontab

hello. we are porting over from HPUX Shell to Linux. my default shell is bash so i can no longer schedule to execute a sh script in crontab. can anyone pls help me out? I searched the site but didnt find any details. thanks! (1 Reply)
Discussion started by: jigarlakhani
1 Replies

10. SCO

start script from - execute init 6 (not as root)

I have 2 questions : ---------------------------------- 1 - How can I execute a program when Unix Sco reboot? For example I have two script (two sockets) that I have to start from 2 different users (root and toto). I heard something about "etc/init.d" directory, but I don't know what to... (4 Replies)
Discussion started by: soshell
4 Replies
Login or Register to Ask a Question