Can crontab execute binary files?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Can crontab execute binary files?
# 1  
Old 12-07-2006
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  
Old 12-07-2006
what are the permissions on your script? What does cron log to your cron-logfile/syslog?
# 3  
Old 12-07-2006
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  
Old 12-07-2006
Except for Linux, few versions of unix have a /bin/sh that supports disown.
# 5  
Old 12-07-2006
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  
Old 12-07-2006
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.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Cannot execute binary file

Hi, When i was trying to execute binary file i am getting the below " cannot execute binary file " error message." My Unix Version is : Red Hat Enterprise Linux Server release 5.1 (Tikanga) Logged in as Sudo user and $PATH Value is below ... (1 Reply)
Discussion started by: Nandy
1 Replies

2. Fedora

Cannot execute binary file

Hi all, Probably somewhat of an obvous problem here but i'm no pro. I just bought a PengPod1000 at pengpod.com On it I have an image of Fedora 18. I am trying to run an application I wrote for Fedora 14 32 bit desktop on this tablet. With all permissions setup using chmod but I get... (7 Replies)
Discussion started by: fedora18
7 Replies

3. UNIX for Dummies Questions & Answers

Xcrysden:Cannot execute binary file

Grettings, Hi and thanks for taking a look at this. I'm going to attempt to explain this the best I possible can but due to my limited knowledge of linux this may prove difficult. I have attempted to install xcrysden on cygwin following the instruction on xcrysden webpage (I attempted to link the... (2 Replies)
Discussion started by: Zbay
2 Replies

4. Linux

Cannot execute binary file

I'm trying to install JasperReports Server 4.1 on Linux Ubuntu (release 11.04) as root and have following message: -bash: ./jasperreports-server-cp-4.1.0-linux-x64-installer.run: cannot execute binary file Is any idea what should I do in order to install Jasper? Previously, I installed... (6 Replies)
Discussion started by: pots06
6 Replies

5. UNIX for Dummies Questions & Answers

Cannot execute binary file

As root, I receive the error message, "cannot execute binary file" when running some commands such as /usr/bin/clear or /usr/sbin/brctl or /usr/sbin/lsof. The system is running RHEL5.5. File permissions are 755. noexec is NOT set on the partitions where these files live. I've spent a... (6 Replies)
Discussion started by: SmithJ
6 Replies

6. SuSE

can not execute binary file

When I am trying to execute a script created by Perl2exe in Linux SLES 8.1 running with virtual machine on mainframe s/390 ....I am getting "cannot execute binary file".... In the linux server which are not in mainframe the scripts are fine..... Thanks for help (1 Reply)
Discussion started by: Anu10
1 Replies

7. Linux

Cannot Execute Binary

Hi, I had changed my compiler options earlier so that it would compile and produce output for ARM but now i want to change it back so that i can get the executable for normal linux, I am facing problem, please help me out... it say -bash: ./a.out: cannot execute binary file When i had a look... (2 Replies)
Discussion started by: niranjanvg
2 Replies

8. Shell Programming and Scripting

cannot execute binary file

HI, i am trying to execute one .bin file which is a pre-installed (not compiled by me). But I am getting the error "cannot execute binary file".I checked the permissions and everything is ok. also I checked ldd <bin-filename> andit showed a msg "not a dynamic executable" Can anyone help in... (4 Replies)
Discussion started by: bhag281
4 Replies

9. Linux

cannot execute binary file

We are getting one error when we execute the binary file below mentioned, and ownership goes to root:nobody, how to resolve this problem. sh /home/pub/bin/awk: cannot execute binary file :confused: Pls help me out . (2 Replies)
Discussion started by: durgaprasadr13
2 Replies

10. Shell Programming and Scripting

Crontab error Cannot execute binary file.

Anyone can help me ? I try to using crontab with a simple shell script as echo it run okay but now i have more command in script. when I set entry to crontab and whe it run i get mail with error cannot execute binary file. it urgent so please help me the soutions. Thank so much for your help.... (5 Replies)
Discussion started by: raccsdl
5 Replies
Login or Register to Ask a Question