Program not running from the cron scheduler

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Program not running from the cron scheduler
# 1  
Old 05-12-2018
Program not running from the cron scheduler

Good Afternoon,

I have a sh script that the admin added to the cron schedule.
It runs fine when I run it manually...but not when scheduled.

I added the path that is found for my user to the script. Still no luck.

Any ideas what I should look at?

Thanks
Marty
# 2  
Old 05-12-2018
This is one of the most common questions on this forum. Please search the forum for answers; you will find a very large number of them.

Basically, the run-time environment between manual running and cron is NOT the same and you need to discover why. Setting of variables, full pathnames, etc.

Just search this forum and keep reading. All the answers are here.
# 3  
Old 05-12-2018
Thank You. I should have done that first.
# 4  
Old 05-12-2018
You're welcome. If after that you are still stuck, post the script on this thread and someone here will very soon tell you what the problem is. Don't waste too much time on it if you can't see it, post the script here.
# 5  
Old 05-12-2018
I will just post the script contents here.

I am such a newbie to this...it is probably something blatantly obvious to experts.
Code:
PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/gl-cli-user/bin:/usr/java/jdk1.6.0_91/bin:/usr/ant/apache-ant-1.6.2/bin:/usr/local/lib

cd /home/gl-cli-user/

current_date=$(date +%m/%d/%Y) 

echo $current_date

nohup ./ledger -comptroller_extract $current_date &


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 05-12-2018 at 04:40 PM.. Reason: Added CODE tags.
# 6  
Old 05-12-2018
Nothing obvious.
Any log file entries? Any error messages? Mayhap sent by mail (you may want to redirect stderr to stdout in the crotab entry). Did you see the echo $current_date output? Add another echo to the end of the script.
Does it wait for interactive input?

Last edited by hicksd8; 05-13-2018 at 12:04 PM.. Reason: Correct typo
# 7  
Old 05-12-2018
Another thought is are you using the same user account to test the script manually as set up in cron?

If not, the access rights may not be set up to allow the cron user to run/access, therefore creating an error in cron that you don't see when running from the command line.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

OS Watcher not running with cron scheduler

Hi team, O.S : Oracle Linux Issue : I am facing issue when running OS watcher script from cron scheduler. But when i run the same command manually, its getting executed. Note : I have to press " Enter " button to get out of the blank screen when I execute the script manually. Below is... (1 Reply)
Discussion started by: madhuraju
1 Replies

2. Red Hat

Cron scheduler issue

I am trying to schedule a script in Linux to between 8th and the 31st of each month on Sundays @ 6:50 only and i scheduled it as follows: 50 6 8-31 * 0 ksh /home/cpac/SPID_Files/GetFiles.ksh Which did it run on the 8th on Saturday instead of only Sundays !!! (3 Replies)
Discussion started by: mrn6430
3 Replies

3. UNIX for Advanced & Expert Users

Autosys Scheduler- Running job at particular time

Hi Experts, I am new to Autosys. I created a Autosys box job to run at 10 AM daily. As scheduled, the job starts on time. There is another box job inside the box. I have scheduled it to run at 11 AM but it kicks off automatically with the main job at 10 AM. insert_job: Main-job ... (2 Replies)
Discussion started by: pk_bohra
2 Replies

4. Shell Programming and Scripting

Help needed regarding cron job scheduler with CyberArk Password security

Hi All, I have a script which will restart some web server and bring it up again. For that I need to retrieve 3 password from CyberArk (Cyber-Ark - Wikipedia, the free encyclopedia) vault. My question is: Is this possible to schedule the script through cron and automatic password... (0 Replies)
Discussion started by: saps19
0 Replies

5. Shell Programming and Scripting

cron job and running program

Dear experts, I have this cronjob * */2 * * * $path/supervisor.sh The supervisor script is checking another script, which initializes the final scripts in multiple directories. Note that the supervisor script runs without the cronjob. In each directory, I have the following script: ... (2 Replies)
Discussion started by: TheTransporter
2 Replies

6. UNIX for Dummies Questions & Answers

CRON JOB SCHEDULER throwing "option not allowed error"

Hi All, Pardon me if this turns out to be a dumb question. But I am trying to schedule a cron job for a my script which takes input options. So an entry in crontab would be something like: 1 * * * * run_report.sh -o out.csv -m monthly -e somename@email.com > cron_output.log 2> cron_error.log... (3 Replies)
Discussion started by: trueharsh
3 Replies

7. Solaris

CRON Scheduler

I have akorn shell job that I can run manually but when I run via cron it starts and finishes, but does not do what it does when I run it manually. Any ideals on why this is happening? (3 Replies)
Discussion started by: CAGIRL
3 Replies

8. UNIX for Advanced & Expert Users

Scheduler program

Hi, what i need to do is build my own scheduler program. I am supposed to display my own prompt. at this prompt i accept a command in the following format. ls -l start 0:0:10:10 period 10 end 0:0:0:10 now this command should be executed in the background starting at 10 mins and 10 secs... (2 Replies)
Discussion started by: p_aishwarya
2 Replies

9. Shell Programming and Scripting

Unix scheduler other than Cron

Do any one know any way of scheduling jobs on Unix without using cron as thats not supported within the company (5 Replies)
Discussion started by: Yziee
5 Replies

10. Shell Programming and Scripting

Job scheduler without using cron

Hi, I want to schedule the scripts/batches to run simultaneously. I had all the information in the config (flat)file, which contains script name, time, dependency, path, priority and status etc., I want to run the jobs parellelly and some jobs are required to give the input. How can I do this?... (1 Reply)
Discussion started by: sharif
1 Replies
Login or Register to Ask a Question