Execution problem with CRON job


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execution problem with CRON job
# 1  
Old 07-23-2015
Execution problem with CRON job

HI,

I have written an executable file in unix and I was able to execute it successfully but when I called this file with cron job it was giving error like "permission denied" and "No such file or directory".

Please help in how cron calls the file and what permission is required on the file being used in executable file and/or what other issue can exist with this.

Thanks,
Vipin Kumar Rai

Last edited by rbatte1; 07-24-2015 at 07:07 AM.. Reason: Spelling and capital letters
# 2  
Old 07-23-2015
you getting "permission denied" or "No such file or directory" ?
How do you invoking the script when you run manually? Is it via using shell binary like

Code:
ksh script_name.sh

If yes, you probably dont have execute permission on the script. Please alter the permissions.
# 3  
Old 07-24-2015
Hello vipin kumar rai ,

I have a few to questions pose in response first:-
  • What actual output/errors do you get? It is important to be accurate.
  • What OS and version are you using?
  • Can you share the script?
  • Can you share the cron definition?
  • Does your script call other things that are not in the $PATH
It is important to know that the $PATH for a cron job is unlikely to be the same as for an interactive session. When a cron job starts, the profiles are not run unless you explicitly call them. Perhaps you could run another very simple cron job to display the value of $PATH and compare them.


Kind regards,
Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Execution problem with Cron

Hi, I'm unable to understand why the grep command in cronjob works intermittently Expected output: Grep command to look for a particular string with today's date and exit from infinite while loop else it must sleep for 5 mins I'm using the following statement in my shell script, the... (9 Replies)
Discussion started by: charlie87
9 Replies

2. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

3. Shell Programming and Scripting

problem with sleep cmd in execution of cron...

I am scheduling a task at regular intervals at seconds acuracy using crond and sleep command . my data in crontab file is as below:- the above line is working fine when we are creating this crontab file before 00:05 min . But when we are creating the crontab file at 00:05min , unable to... (10 Replies)
Discussion started by: manoj424
10 Replies

4. Shell Programming and Scripting

Problem with Job execution using crontab

Hi All, I am facing a problem with crontab.I made an entry in crontab like this 05 07 * * * /afs2/cdwfullacc/current/exe/cdw_generate_special_klant.sh > /afs2/cdwfullacc/current/scratch/cdw_gen_cron.log But job was not getting executed. Entry in crontab was made with same user by whom... (4 Replies)
Discussion started by: krishna_gnv
4 Replies

5. UNIX for Dummies Questions & Answers

Cron job problem

I have a perl script which Im planning to run every minute. I have set the cron job as * * * * * PATH= /usr/local/bin:/usr/bin:/usr/sbin:/usr/lib; perl /dm2/www/html/isos/pre5.3/autoDownload.pl I assume the script is executing every minute only because I see a entry like below when I do... (2 Replies)
Discussion started by: srijith
2 Replies

6. AIX

Execution Problem with Cron

Guys, I am beginer in unix. There is a cobol file with fixed-width. I want to read the total Line, Word and character count. I have tried with wc-l unix command, but it returns '0'. Please advice me the correct command/steps to get the record count. Thanks in advance. (4 Replies)
Discussion started by: vibhar
4 Replies

7. Solaris

Solaris 10.5 perl and cron job execution problem

Hi, I want to run a crontab job on solaris 10.5. I have configured the crontab accordingly 10 * * * * /scripts/dbalter.pl >> /scripts/cronout.txt However this does not work .Then I go to /var/mail/root and find an error in the output: From root@myserver Wed Feb 4 17:02:00 2009... (1 Reply)
Discussion started by: sonu2die4
1 Replies

8. Solaris

problem with cron job

new to unix here, im learning how to schedule jobs with crontab. The following cron job runs under root but not under a test account i created. 50 11 * * 0 /usr/bin/banner "HELLO" > /dev/console i have no idea with it isn't running under the test account but runs right on time when i create... (7 Replies)
Discussion started by: solne
7 Replies

9. Solaris

cron job problem

I am trying to setup cronjob and once I start to save it is not working. This is what I am getting after I executed crontab -e, I am not even getting the privious entry and I am running from root. crontab -e 421 10 3 * * * /usr/sbin/logadm ? :wq ? Why is it not saving? Any input is... (4 Replies)
Discussion started by: mokkan
4 Replies

10. Shell Programming and Scripting

Sequential execution of job in cron

Hi I have a file say xyz.sh, whose contents are as follows : *************************** #! /bin/ksh set -x . /a.sh . /b.sh . /c.sh ***************************** Now will this execute all the three process simultaneously or sequentially? If it will process simultaneously, is... (3 Replies)
Discussion started by: pankajkrmishra
3 Replies
Login or Register to Ask a Question