Cron job is not running on schedule


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Cron job is not running on schedule
# 1  
Old 07-21-2019
Cron job is not running on schedule

Scheduled job is not running on time.but it is running when executing same command manually.
Code:
25 10 * * * /code/bin/ACCOUNT.ksh 1  >/dev/null 2 >&1

Manually executing the same
Code:
Ksh -x  /code/bin/ACCOUNT.ksh 1  >/dev/null 2 >&1

Followed steps
Code:
Crontab -e

Added the job to cron tab.
# 2  
Old 07-22-2019
You should consider running your working "manual" command the same in cron.

As a quick cut-and-paste example from your post:

Code:
25 10 * * * /bin/ksh -x  /code/bin/ACCOUNT.ksh 1  >/dev/null 2 >&1

Please modify for your environment.
# 3  
Old 07-22-2019
But other jobs are running with same command I would like to know why my job is not running.
Other job.
Code:
10  8 * * * /code/bin/DAILY_STATS.ksh 1  >/dev/null 2 >&1

I am not using any parameter in my .ksh file.
# 4  
Old 07-22-2019
Quote:
Originally Posted by Myguest
But other jobs are running with same command I would like to know why my job is not running.
Other job.
Code:
10  8 * * * /code/bin/DAILY_STATS.ksh 1  >/dev/null 2 >&1

I am not using any parameter in my .ksh file.

You would need to provide us copies of all scripts, user ids, file permissions, etc for an answer.

You are asking us to "read the mind" of your computer, which is simply an exercise in playing a guessing game.

If you really want an answer, you must profile details (all details).
# 5  
Old 07-22-2019
cron has minimal environment.
You can simulate it on the command line:
Code:
/usr/bin/env -i USER=$USER HOME=$HOME PATH=/bin:/usr/bin /code/bin/ACCOUNT.ksh

env -i clears the environment, then USER and HOME are set from the current env, and PATH is set to the default, then the command is run.

If you do not use parameters 1 and 2 then you should use 1>/dev/null and 2>&1 (no spaces!) to supress eventual output.
But not for the test on the command line - here you want to see something!

Last edited by rbatte1; 07-22-2019 at 08:14 AM.. Reason: Correcting end CODE tag marker
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Schedule the cron job for every 21day on saturday

Please guide me how to schedule the cron job to run on every Saturday at 6am with the interval of 21 days. (2 Replies)
Discussion started by: raghavendrajsv
2 Replies

2. Shell Programming and Scripting

schedule a job without Cron

Hi All, Is there any way (any utility) to schedule a job to run once in a week on RedHat Linux ? Note- Do not using Crontab. Thanks Pravin (1 Reply)
Discussion started by: pravin27
1 Replies

3. UNIX for Dummies Questions & Answers

Schedule a cron job

Hi, Can anyone help me out with scheduling a cron job for the below: i wnated to delete file from a folder on every sunday at 05:00 AM this is code i have used. ******************************************************* 0 05 * * 0 find /abc/xyz/pqrs/bak/ -type f -mtime +30 -exec rm -f... (5 Replies)
Discussion started by: ch33ry
5 Replies

4. Shell Programming and Scripting

Schedule a Cron job

Hi all, I am new to cron jobs.. i wanted to schedule a cron job that wil send a mail to me at 3:00PM on 10th August ie is on Wednesday. 0 15 10 8 3 echo "message from UNIX here"|mail -s "your subject here" user@user.com However this was not executed... Can anyone please... (0 Replies)
Discussion started by: ch33ry
0 Replies

5. Shell Programming and Scripting

Cron to schedule job at different times

Hi, I want to run cron scheduler to run some script at different times of the day.But these times don't have some fix intervals. So how we can run jobs at 6:30AM, 1:00PM and 4:30PM everyday. Please help. Thanks Neeraj (2 Replies)
Discussion started by: apjneeraj
2 Replies

6. Shell Programming and Scripting

unable to schedule job in cron

Hi, from normal user(oracle) i am unable to run scheduled job in cron: os version: bash-2.03$ uname -a SunOS sumail02 5.8 Generic_117350-39 sun4u sparc SUNW,Ultra-60 bash-2.03$ crontab -l 55 * * * * sh /oracle/statistics.sh > /dev/null 2>&1 bash-2.03$ cat /oracle/statistics.sh... (2 Replies)
Discussion started by: prakash.gr
2 Replies

7. Shell Programming and Scripting

How to Schedule job using cron(URGENT)

Hello All, I m newbie to Job scheduling. Suppose i have 2 files s1.sh and s2.sh i want to make a schedule such as run s1.sh at 2AM everyday and run s2.sh 9Pm everyday. Can anyone tell me how to schdule that using CRON and i want to know what is CRON and CRONTAB. Thanks in advance (2 Replies)
Discussion started by: ravi.sadani19
2 Replies
Login or Register to Ask a Question