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 Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help in automating dates in ksh script italia1971luca Shell Programming and Scripting 1 06-04-2008 06:29 AM
Help with script - run by cron richo king Shell Programming and Scripting 2 03-05-2008 08:36 PM
Automating Logform Command in a script TheDoc Shell Programming and Scripting 2 07-03-2006 08:14 AM
automating sftp script Rajeshsu Shell Programming and Scripting 1 07-27-2005 04:06 PM
Cron Script Q doublek321 Shell Programming and Scripting 2 07-06-2004 09:35 PM

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 12-19-2007
hassanj hassanj is offline
Registered User
  
 

Join Date: Aug 2007
Location: WALES
Posts: 7
cron ? automating a script

Hi all.
basically i need to run a script every 30 minutes.
my script is simply an error report:

errpt

thats it, is there anyway to make this happen every 30 minutes
without having to type errpt in, the script will get bigger as i add more things to do but just need to know how to automate it.
Also dont know anything about cron
thanks guys.
  #2 (permalink)  
Old 12-19-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Seek and ye shall find.

Search for crontab here on this forum.
  #3 (permalink)  
Old 12-19-2007
prowla prowla is offline
Read Only
  
 

Join Date: Nov 2007
Posts: 165
Here is a cron entry that would probably work:
Code:
0,30 * * * * /mydir/errpt
However, there are some gotchas:
1. You may not have permission to run cron jobs, so cron.allow would need your account name adding. (And easy way to check is to issue the command "crontab -e" and see if it errors or works.)
2. Your script may not work depending upon the scripting language you've used and OS you're running on (ie. Solaris comes with only Bourne shell support in cron).
3. Your script may assume environment variables that work when you run it interactively, but aren't there when it's run via cron.
4. Your OS (bloomin' Solaris again!) may be configured to only allow a limited number of concurrent cron jobs, so other schedules may impact yours.

Have fun!

Last edited by prowla; 12-19-2007 at 05:27 PM.. Reason: amendment
  #4 (permalink)  
Old 12-19-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by prowla View Post
2. Your script may not work depending upon the scripting language you've used and OS you're running on (ie. Solaris comes with only Bourne shell support in cron).
I've just checked on Solaris 9 on SPARC, it happily runs cron jobs using sh, ksh or csh. Not sure what you were implying.
  #5 (permalink)  
Old 12-19-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
Quote:
Originally Posted by porter View Post
I've just checked on Solaris 9 on SPARC, it happily runs cron jobs using sh, ksh or csh. Not sure what you were implying.
I'm pretty this refers to the use of logic in the command in the crontab, or at least that is the only place I can see it making any difference. The job itself is executable or it is not, the interpreter makes no difference.
  #6 (permalink)  
Old 12-19-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by reborg View Post
The job itself is executable or it is not, the interpreter makes no difference.
... or the interpretor depended on shared libraries found on LD_LIBRARY_PATH that was not set up.
  #7 (permalink)  
Old 12-19-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
true; I limiting myself to the crontab but yes that is a possibility also.

Then again everybody know that CRON will only give an environment consisting of
HOME
LOGNAME
PATH guaranteed only to find all of the standard utilities.
SHELL

and code accordning don't they
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 05:51 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