no shell invoked in crontab


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting no shell invoked in crontab
# 1  
Old 10-26-2006
no shell invoked in crontab

Hi all,

I am trying to run a script in crontab but I receive the email below. Note the empty variable SHELL. Apparently cron doesn't invoke a shell. That explains the errors in the script it is trying to execute. Anyone know what maybe wrong?


Subject: Output from cron job /vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh db1, ivanushka@db1, exit status 0

Cron Environment:

SHELL =
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/java131/jre/bin:/usr/java131/bin
CRONDIR=/var/spool/cron/crontabs
ATDIR=/var/spool/cron/atjobs
LOGNAME=/vp1_ftp
HOME=/vp1_ftp/itgadba/ivanushka

Your "cron" job executed on db1 on Thu Oct 26 09:05:00 MESZ 2006

/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh db1
produced the following output:

/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: hostname: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: clear: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: uname: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: wc: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: ps: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: grep: not found.
# 2  
Old 10-26-2006
is script working from your home direcotry

and can you post cron entry of the same
# 3  
Old 10-26-2006
Here is the criontab entry

# statspack snapshots
10 * * * * /vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh db1


The script runs perfectly from my home directory (or any other shell/ directory)
# 4  
Old 10-26-2006
Quote:
Originally Posted by ivanushka
Hi all,

I am trying to run a script in crontab but I receive the email below. Note the empty variable SHELL. Apparently cron doesn't invoke a shell. That explains the errors in the script it is trying to execute. Anyone know what maybe wrong?
...
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: hostname: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: clear: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: date: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[3]: uname: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: wc: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: ps: not found.
/vp1_ftp/prd/dba/dbm/scripts/cr_sp_snap.sh[2]: grep: not found.
How do you know that cron is not invoking a shell? What do you think is reporting the errors that you have presented?

Read this post and especially look at the section titled "It works from the command line but not in crontab."
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Oracle function invoked from shell script doubt

hi gurus, I have tried myself to invoke an oracle function. there are three different function available need to be called for differnt. can you tell me whether the below code is correct to call oracle function from shell script. Any help would be highly appreciated. cat location.sh ... (5 Replies)
Discussion started by: arun888
5 Replies

2. Shell Programming and Scripting

Problem with script invoked from a keyboard shortcut

-EDIT- I have solved my problem below by using a different program. Instead of xsel I am using xclip which basically does the same thing and works fine from a script invoked by a global hotkey. -END EDIT- Hi, I've written a simple script to copy my email address into both the... (0 Replies)
Discussion started by: gencon
0 Replies

3. AIX

How to know the first time a daemon was invoked?

I have an investigation job at hand where I have to know when was the FIRST time the daemon was invoked. Now, currently what I can see as the time since invoked was some where near the last reboot which is kind of obvious that the daemon stopped and recycled after reboot. But I want to know the... (6 Replies)
Discussion started by: TH3M0Nk
6 Replies

4. Shell Programming and Scripting

How to ensure a script can only be invoked from another?

Hi All, I have two scripts - ScriptA and ScriptB ScriptA has logic to invoke ScriptB : - with some parameter - or without any parameter ScriptB can also be invoked by the user from the command line. Is there anyway to ensure that when I execute ScriptB from the command line, it does... (3 Replies)
Discussion started by: chaitanya.gvc
3 Replies

5. Shell Programming and Scripting

CRON: Script not getting invoked

Hi, I have the following script - fixpart="/files/myScript # Transfer Script" echo "Specify the transfer frequency in minutes - " echo "every 1, 2, 3, or 5 minutes (default every 1 minute) " echo $nn "Frequency ? :" $cc read ans case $ans in 2) echo... (9 Replies)
Discussion started by: angshuman_ag
9 Replies

6. Solaris

expect package is not invoked from cron

Hi, I am running some etl commands in the windows from shell script(from unix sun solaris 5.9) by using expect package .While running manually the script is working fine.While running from cron it is exiting the after successfully firing the ETL command(The control does not stop after firing... (1 Reply)
Discussion started by: megh
1 Replies

7. UNIX for Advanced & Expert Users

why the script name not displayed and not sh invoked?

Say there is a shell script named test.sh. I intentionally omit the #! line in test.sh for testing perpose. I did the following : $ echo $0 -ksh ---> current shell $ echo $$ 12919 ---> PID of the current shell... (4 Replies)
Discussion started by: hongwei
4 Replies

8. Shell Programming and Scripting

determine if the script has been invoked manually or not?

Hi, Is there a way to determine if the script has been invoked manually or not( might be invoked by a schedular or crontab)? Thanks, (8 Replies)
Discussion started by: hitmansilentass
8 Replies

9. Shell Programming and Scripting

License error when Invoked from Java Code

Hi all, I am getting a License error when Iam trying to call a perl script which builds TestRT (Test Real Time) application. When Iam calling the same script from command prompt it is building successfully. Iam using Solaris 9 Operating system. I have checked all the environment variables... (0 Replies)
Discussion started by: srini.g
0 Replies

10. Shell Programming and Scripting

scp between 2 servers - invoked at 3rd server

I have a couple of servers that can't see each other and need to copy files from one to the other. I try to invoke scp from a 3rd server that can see both servers - get error msgs that are cryptic. from server C I can do scp user@serverA:~/file . scp file user@serverB:~ but if I try to... (2 Replies)
Discussion started by: bigjohn-nj
2 Replies
Login or Register to Ask a Question