Crontab entry issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab entry issue
# 1  
Old 04-17-2012
MySQL Crontab entry issue

Hi, I added below entry in crontab. Cron is triggering the script but actual script is not running.

Cron entry:
Code:
45 * * * * /data/crons/Purge/TransferLogMaint.sh 3 20000 300 > /dev/null 2>&1

Cron log entry:
Code:
Apr 17 12:45:01 <servername> crond[12058]: (root) CMD (/data/crons/Purge/TransferLogMaint.sh 3 20000 300 > /dev/null 2>&1)

Can anyone help with this please....


thanks
Moderator's Comments:
Mod Comment How to use code tags

Last edited by Scrutinizer; 04-17-2012 at 06:42 PM..
# 2  
Old 04-17-2012
instead of directing output and error to /dev/null , write it in a temp file and check what the error is. That info would be helpful in further troubleshooting
# 3  
Old 04-17-2012
Hi shailesh, thanks for the reply. I did wirte to temp file but nothing written to log file because the script did not run.
If we are passing parameters to a script in cron do we need to use any extra conditions?
# 4  
Old 04-17-2012
Hi,

have the file the right (execution) permission?
Code:
chmod 750 TransferLogMaint.sh


Last edited by Scrutinizer; 04-17-2012 at 06:41 PM..
# 5  
Old 04-17-2012
No extra condition required for parameters from cron.
Can you post you script here ?
# 6  
Old 04-17-2012
Please post what Operating System and version you have and what Shell you use.

Please look in the unix mail file for the owner of the crontab. If there is anything fundamentally wrong (like execute permissions on the script) it will be in there.


Ps. Quite clearly the cron did fire because it appears in the cron log.
Each cron run has a fairly unique identity/pid (in your case 12058). Use grep to find any more lines for that cron (from the inception to the end/failure) and pay particular attention to lines containing response codes rc=.

Last edited by methyl; 04-17-2012 at 07:02 PM.. Reason: cover the fact that pids are recycled and not everybody starts a new cron log as often as me
# 7  
Old 04-17-2012
bad post
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Crontab entry

Is this the correct entry to touch a file on 6/6 5AM? 00 05 06 06 * touch /support/home/.no_copy Please use next time code tags for your code and data (5 Replies)
Discussion started by: Me XMan
5 Replies

2. Solaris

crontab entry

hi i am new in solaris. i am accessing server through putty. i could not add entry in crontab. i have given "crontab -e" for add a new entry. It is not coming. what parameter i have to set for getting crontab -e thanks (1 Reply)
Discussion started by: sunnybee
1 Replies

3. UNIX for Dummies Questions & Answers

Crontab entry

What should be the crontab entry for a script: to run at 3:00 AM EST Sun, Mon, Tue, Wed, Thu, Fri (3 Replies)
Discussion started by: proactiveaditya
3 Replies

4. Solaris

crontab entry

Hi, i need to setup a cronjob that has will execute iostat command from morning to evening time. for instance the timing has will be like this. 8:00 A.M -- 6:00P.M how to define this entry in crontab Regards (3 Replies)
Discussion started by: jaweedak
3 Replies

5. Solaris

crontab entry

How to set the crontab entry for every other Friday? Regards, Raj (1 Reply)
Discussion started by: rajip23
1 Replies

6. AIX

crontab entry

Hi. I'm new to AIX and I need to create a crontab entry to run a script every first 5 business days of the month? please help. (2 Replies)
Discussion started by: udelalv
2 Replies

7. Shell Programming and Scripting

Crontab Entry

Hi Everyone , have a nice day given below is the line i have added in crontab * * * * * /Rauf/script2.sh intended to run this script after every minute , when i run this script manually it runs fine and produces output , but after adding it to crontab ( like given above ) , it doesnt work ... (5 Replies)
Discussion started by: Dastard
5 Replies

8. Shell Programming and Scripting

Crontab entry

Hello, I am trying to schedule a job to run every 15 minutes from 7am to 5:30pm. Could someone show me the syntax for this? Thanks. (1 Reply)
Discussion started by: bestbuyernc
1 Replies

9. UNIX for Dummies Questions & Answers

crontab entry

hi all how to schedule a cron job running on last day of every third month at 12 midnight will the following work 0 0 30,31 3,6,9,12 * <required file> thanks (3 Replies)
Discussion started by: matrixmadhan
3 Replies
Login or Register to Ask a Question