The UNIX and Linux Forums  

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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
crontab couldn't run through, help duke0001 UNIX for Advanced & Expert Users 10 02-05-2008 11:22 PM
help with crontab bob122480 Shell Programming and Scripting 3 01-22-2007 04:49 PM
Crontab gen4ik UNIX for Dummies Questions & Answers 1 01-18-2007 03:26 AM
ftp and crontab user` Shell Programming and Scripting 27 11-13-2006 04:02 PM
Crontab lo-lp-kl UNIX for Dummies Questions & Answers 2 05-05-2005 03:21 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-19-2007
sumesh.abraham
Guest
 

Posts: n/a
Stumble this Post!
Using Crontab

Hi All,

I've a shell script which calls a Sybase stored procedure to do some functionality. I want to schedule the running of this script by crontab. I'm using Solaris 5.8. When i executed the following command
Code:
crontab -l
i got the output as
Code:
crontab: can't open your crontab file
How can i schedule the script. I'm not the administrator. How can i unschedule it later as this script is a sample script.

Thanks in advance
Sumesh
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-19-2007
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Stumble this Post!
That means that you do not yet have a crontab.
Code:
crontab -e
to edit (and thus create) it.

To view syntax on the crontab command, and the crontab file itself (as well as cron facility access controls, etc)...
Code:
man crontab
If you want to unschedule your job, either crontab -e, then remove the line containing the job completely, or just comment it out. Else; if that's the only job in your crontab, crontab -r to delete the crontab entirely.


Cheers
ZB
Reply With Quote
  #3 (permalink)  
Old 02-19-2007
sumesh.abraham
Guest
 

Posts: n/a
Stumble this Post!
ZB,
Thanks for the reply.

I created the crontab file and my file looks like
Code:
47,3,19,2,1 /home/dsdev/bdayfinder.sh
I want the aforesaid script to get executed at the specified time, but i get the error like

Code:
crontab: error on previous line; unexpected character found in line.
crontab: errors detected in input, no crontab file generated.
I've checked the file thoroughly and couldn't trace the problem.

Pls help me out.

Sumesh
Reply With Quote
  #4 (permalink)  
Old 02-19-2007
Moderator
 

Join Date: Feb 2007
Posts: 1,962
Stumble this Post!
Did you read the man page?
The syntax of your line isn't correct, the 5 time and date fields must be seperated by spaces or tabs.

Regards
Reply With Quote
  #5 (permalink)  
Old 02-19-2007
sumesh.abraham
Guest
 

Posts: n/a
Stumble this Post!
Thanks for the reply.

I used the correct synatx and now my crontab file is
Code:
50 1 20 2 * /home/dsdev/bdayfinder.sh
But, the script specified above is not getting executed.

I checked the /usr/lib/cron directory. There is no cron.allow file and the username dsdev which i use is not present in cron.deny as well.

I edited the crntab file and included the above mentioned line, saved and came out of the editor. The script which is expected to be triggered at 1:50 is not getting triggered at that time.

Pls let me know what has gone wrong?

Thanks,
Sumesh
Reply With Quote
  #6 (permalink)  
Old 02-19-2007
aigles's Avatar
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,211
Stumble this Post!
Check your mails for error messages from crn dealon.

Quote:
The cron daemon runs commands according to the crontab file entries. Unless you
redirect the output of a cron job to standard output or error, the cron daemon
mails you any command output or errors. If you specify a cron job incorrectly in
your crontab file, the cron daemon does not run the job.

Jean-Pierre.
Reply With Quote
  #7 (permalink)  
Old 02-20-2007
sumesh.abraham
Guest
 

Posts: n/a
Stumble this Post!
The script which i try to get scheduled is having isql command in it. The crontab file is set as follows.
Code:
* * * * * cd; script.sh > /tmp/result 2>&1
the file result in /tmp directory shows

Code:
isql: not found
I came to know that the isql is not set in the PATH environment variable.

Presently the PATH environment variable in my .profile file is
Code:
export PATH=$SYBASE_OCS/bin:$DSHOME/bin:$ORACLE_HOME/bin:/usr/local/bin/:/usr/ccs/bin:/usr/local/SUNWspro/bin:$PATH
Will including isql into this will solve the problem. If so, how can i modify it.

Thanks,
Sumesh
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0