The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Calling a perl script from a perl script new2ss Shell Programming and Scripting 6 05-24-2009 05:03 PM
a cron job needs a perl script to execute Exader UNIX for Dummies Questions & Answers 2 04-22-2008 03:45 PM
Install a cron from a Perl script garric Shell Programming and Scripting 2 09-13-2007 05:00 AM
How to determine if a script (perl) was called from a CRON job or commandline jerryMcguire Shell Programming and Scripting 2 03-23-2006 10:47 AM
Perl: Run perl script in the current process vino Shell Programming and Scripting 10 12-09-2005 10:45 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-25-2007
man man is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 13
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 called the script inside a ksh script to be able to the set environment path (only way I knew how).. After going through this, the cron job still isn't working.. I've manually tested the script(s) many times with success, so I'm thinking that it has to be an environment issue? TIA
  #2 (permalink)  
Old 07-25-2007
Shell_Life's Avatar
Shell_Life Shell_Life is offline
Registered User
  
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
Man,
Please show us how you are calling the script to set the environment
variables and the error message you are having.
  #3 (permalink)  
Old 07-25-2007
man man is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 13
ok.. the details are below..

crontab -l shows:

1 * * * * /home/<user>/bin/myscript.sh

Here is how I have myscript.sh
Code:
#!/bin/ksh
set PATH=/home/<user>/bin
export PATH

/home/<user>/bin/perlscript.pl
I have verified that myscript.sh executes successfully, but the cron job seems to be where my trouble is.. Hopefully someone can point out my mistake(s).
  #4 (permalink)  
Old 07-26-2007
man man is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 13
I figured out what I was doing wrong, I had the cron job incorrect. It was running every 1st minute of the hour.. I wanted it to run every minute (for testing).. So it should have been * * * * *, instead of 1 * * * *.. Idiotic, i know..
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0