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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
crontab entry Sowser UNIX for Advanced & Expert Users 4 01-08-2007 05:34 PM
remove an entry in crontab melanie_pfefer SUN Solaris 1 12-18-2006 05:45 AM
amending crontab entry hcclnoodles Shell Programming and Scripting 1 10-26-2006 08:32 AM
Crontab entry bestbuyernc Shell Programming and Scripting 1 09-12-2005 04:13 PM
crontab entry matrixmadhan UNIX for Dummies Questions & Answers 3 06-07-2005 09:57 AM

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

Join Date: Jul 2006
Posts: 47
Arrow Crontab Entry

Hi Everyone , have a nice day
given below is the line i have added in crontab

* * * * * /Rauf/script2.sh

intended to run this script after every minute , when i run this script manually it runs fine and produces output , but after adding it to crontab ( like given above ) , it doesnt work

can anyone help

attributes of this script are

-rwxr-xr-x 1 root other 162 Feb 8 19:51 script2.sh*

Regards and Waiting
  #2 (permalink)  
Old 02-08-2007
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
We might have some ideas if you show us the script.

But some options are:
- You say the script produces output, where is this output send? To a file or to the screen? If it is the screen the script will not work because there is no tty attached to t.
- A cron job runs by default with a very limited PATH environment variable. So if you don't define PATH inisde your script correctly, or use all commands with their full pah name, it could be that 1 or more commands cannot be located and therefore result in an error, which cause your script to terminate.
  #3 (permalink)  
Old 02-08-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,211
There are *hundreds* of threads here where this has been answered. Please use the search function.
  #4 (permalink)  
Old 02-09-2007
Dastard Dastard is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 47
#!/bin/sh
sleep 10
echo > /opt/scripts/air01axml.txt
echo >> /opt/scripts/air01axml.txt
rsh air01a tail -1 /var/opt/fds/statistics/FSC-AirXmlRpc_2.0_A_1-`date +%Y-%m-%d`-0000.stat >> /opt/scripts/air01axml.txt

This is the script ..
  #5 (permalink)  
Old 02-09-2007
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
Make your crontab entry like this:

* * * * * /Rauf/script2.sh > /tmp/result 2>&1

check /etc/result for errors.
  #6 (permalink)  
Old 02-10-2007
srikanthus2002's Avatar
srikanthus2002 srikanthus2002 is offline
Registered User
  
 

Join Date: Sep 2006
Location: Can u guess...!
Posts: 160
Try this...
Code:
* * * * * cd /Rauf; script2.sh > /tmp/result 2>&1
check /tmp/result for error

and
check /var/cron/log file for cron
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 08:01 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