The UNIX and Linux Forums  

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
Crontab error Cannot execute binary file. raccsdl Shell Programming and Scripting 5 11-13-2007 06:22 AM
how to execute sh script in bash shell via crontab jigarlakhani UNIX for Dummies Questions & Answers 1 06-23-2007 09:50 PM
Need to execute a complete url from crontab nissar Shell Programming and Scripting 2 08-11-2006 06:18 AM
compiled binary file gives "cannot execute binary file" scgupta SUN Solaris 0 07-13-2006 02:59 AM
crontab ..sqlplus cannot execute zikronz High Level Programming 1 04-29-2005 11:03 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 12-07-2006
Tris Tris is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 20
Can crontab execute binary files?

Hello!

I have an entry on my crontab.

10 00 * * * /bscsprod/bscs/prod/523/bin/tehcron.sh

$ /bscsprod/bscs/prod/523/bin/vi tehcron.sh
nohup teh -t -f > /dev/null &
~
~
~
~
~
~
~
~
"tehcron.sh" 13 lines, 365 characters

but executing the script from the commandline, it works.
$ /bscsprod/bscs/prod/523/bin/tehcron.sh
$ /bscsprod/bscs/prod/523/bin:INFC $ ps -ef|grep teh
bscsprod 4983 1 6 20:15:44 ttyp3 0:00 teh -t -f
  #2 (permalink)  
Old 12-07-2006
bin-doph bin-doph is offline
Registered User
  
 

Join Date: Jan 2004
Posts: 17
what are the permissions on your script? What does cron log to your cron-logfile/syslog?
  #3 (permalink)  
Old 12-07-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,960
Try adding the standard #! line to the top of your script, as well as these modifications:
Code:
#!/bin/sh
nohup teh -t -f > /dev/null < /dev/null 2> /dev/null & disown
I've been left wondering why my ssh window wouldn't close when it turns out I left things running still using the terminal's stdin and stderr.
  #4 (permalink)  
Old 12-07-2006
Perderabo's Avatar
Perderabo Perderabo is online now Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,125
Except for Linux, few versions of unix have a /bin/sh that supports disown.
  #5 (permalink)  
Old 12-07-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,960
Quote:
Originally Posted by Perderabo
Except for Linux, few versions of unix have a /bin/sh that supports disown.
Good to know. Is it that they don't need it, or do they simply not support leaving processes behind?
  #6 (permalink)  
Old 12-07-2006
Perderabo's Avatar
Perderabo Perderabo is online now Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,125
Quote:
Originally Posted by Corona688
Good to know. Is it that they don't need it, or do they simply not support leaving processes behind?
Neither one. disown is simply a useful command invented by the bash developers and not available in other shells. I would like to see it in ksh. It's not clear why you think this stuff might be useful here though. There is no terminal involved with cron jobs unless the cron job opens one. So there is no controlling terminal to send a hup. ssh is different because a pty is involved. It would take an explicit kill -1 to send a hup to a cron job.

But closing 1 and 2 or redirecting them to /dev/null is a good idea, cron tend to gather these up and mail them to the user. People who write poor cron jobs then get a lot of mail which they never read and it fills up /var.
Closed Thread

Bookmarks

Tags
linux

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 11:52 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