Solaris 10.5 perl and cron job execution problem


 
Thread Tools Search this Thread
Operating Systems Solaris Solaris 10.5 perl and cron job execution problem
# 1  
Old 02-05-2009
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
Code:
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:
Code:
From root@myserver Wed Feb  4 17:02:00 2009
Return-Path: <root@myserver>
Received: from myserver (localhost [127.0.0.1])
        by myserver (8.13.8+Sun/8.13.8) with ESMTP id n14N20Rx027373
        for <root@myserver>; Wed, 4 Feb 2009 17:02:00 -0600 (CST)
Received: (from root@localhost)
        by myserver (8.13.8+Sun/8.13.8/Submit) id n14N20Is027371
        for root; Wed, 4 Feb 2009 17:02:00 -0600 (CST)
Date: Wed, 4 Feb 2009 17:02:00 -0600 (CST)
From: Super-User <root@myserver>
Message-Id: <200902042302.n14N20Is027371@myserver>
To: root@myserver
Subject: Output from "cron" command
MIME-Version: 1.0
Content-Type: text/plain
Content-Length: 136

Your "cron" job on myserver
/usr/bin/perl/ /scripts/dbalter.pl

produced the following output:

sh: /usr/bin/perl/: cannot execute

bash-3.00£ env
LC_MONETARY=en_US.ISO8859-1
TERM=xterm
SHELL=/sbin/sh
SSH_CLIENT=138.85.45.27 28249 22
LC_NUMERIC=en_US.ISO8859-1
OLDPWD=/
SSH_TTY=/dev/pts/2
USER=root
PATH=/usr/sbin:/usr/bin
MAIL=/var/mail//root
LC_MESSAGES=C
LC_COLLATE=en_US.ISO8859-1
PWD=/var/adm
EDITOR=vi
TZ=US/Central
SHLVL=1
HOME=/
LOGNAME=root
SSH_CONNECTION=138.85.45.27 28249 10.25.30.190 22
LC_CTYPE=en_US.ISO8859-1
LC_TIME=en_US.ISO8859-1
_=/usr/bin/env

Also I want to mail the output to an outlook account. Please let me know about it. I really appreciate the help.

Regards
Sonu

Last edited by otheus; 02-10-2009 at 11:15 AM.. Reason: formatting and [code] tags
# 2  
Old 02-10-2009
The first line of your script should look like
Code:
#!/usr/bin/perl

and NOT like
Code:
#!/usr/bin/perl/

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. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: vipin kumar rai
2 Replies

3. 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

4. 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

5. 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

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. Shell Programming and Scripting

SolarisCron job perl script execution error

Hi, I want to run a crontab job on solaris10.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:... (4 Replies)
Discussion started by: sonu2die4
4 Replies

8. UNIX for Dummies Questions & Answers

a cron job needs a perl script to execute

Hello evreyone, this is my first post, and to say i'm new to this is an understatement. I know very little about perl scripts and hope some one can help me. i'm looking to get a script that a cron job can execute. what the script needs to to is 1) connect to a mysql database 2) go to a... (2 Replies)
Discussion started by: Exader
2 Replies

9. UNIX for Advanced & Expert Users

Cron job for Perl script

Although there are many threads on this forum regarding cron, none have specifically answered my question. So hopefully someone can shed some light on what I'm doing wrong.. I have a perl script that I want to run in a cron job. Since I've read that cron doesn't have any environments set, I... (3 Replies)
Discussion started by: man
3 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