Crontab error Cannot execute binary file.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab error Cannot execute binary file.
# 1  
Old 11-09-2007
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. Smilie
# 2  
Old 11-09-2007
Please post your crontab file text and the script text as well.

Even if I myself may not be able to solve your problem even after seeing those, but it will surely help anyone who is knowledgeable enough.

Also check that your script has execute permission .
# 3  
Old 11-10-2007
Thank for your reply.

============This is content of crontab file ====================

19 2 * * * /etc/webmin/cron/tempdelete.pl
0 * * * * /etc/webmin/bandwidth/rotate.pl
0,10,20,30,40,50 * * * * sh /root/temp/testing/autoimport >> /root/temp/testing/errorlog

===================Script autoimport=======================

sh import Testfolder


My shell script below for import data to Oracle

it run okay. but the text display not correct follow order command executed.

=========================Shell Script import file=================

#!/bin/sh

#directory = ${1-'pwd'}


#run import data with SQLLoader
runSQLLoader()
{
/home/oracle/app/oracle/product/11.1.0/db_2/bin/sqlldr test/12345@orcl control=$1 bad=$2 log=$3 discard=$4 data=$5 direct=TRUE;
if [$? -ne 0]
then
return 1
else
return 0
fi
}

ARGS=1
filecontrol="ControlFile/test.ctl"

if [ $# -ne "$ARGS" ];
then
directory=`pwd`
else
directory=$1
fi

for file in $(find $directory -type f )
do
fname=`basename $file`

#display the file to miport data
echo "Excute importing file : $fname "

#asking user waiting for this job finish
echo "Please waiting for you look finished task"

errorfile="Error/$fname"
processedfile="Processed/$fname"
badfile="Processed/bad$fname"
discardfile="Processed/discard$fname"
logfile="Processed/log$fname"

#run function above
runSQLLoader $filecontrol $badfile $logfile $discardfile $file;
#get result of importing data if 1 have error or 0 it importing okay
if [$? -ne 0]
then
echo "Error ! Have an error happen during import data "
mv "$file" "$errorfile"
else
echo "Finish importing file : $fname"
mv "$file" "$processedfile"
fi
done | sort

exit 0
======================End Shell Script code=================


I has set chmod 777 to this file. I got e mail from cron have error like this :
/usr/bin/import: /usr/bin/import: cannot execute binary file.

I think, the name of my script file maybe similar with the system file.

I Has changed the file name to importdata and get this error sh: importdata No such file or directory.

Please I ask my problem when I run sheel script. If I run shell script from file name as importdata I got error Command not found.

But when I put sh in font of importdata it run okay ? Please explain for me more about this thing. Thank so much.

I am a newer. I try using the shell scritp only 3 day.

Thanks.
# 4  
Old 11-10-2007
Existing :
sh import Testfolder

change to
sh <full_path>/import Testfolder
# 5  
Old 11-10-2007
Quote:
Originally Posted by raccsdl
/usr/bin/import: /usr/bin/import: cannot execute binary file.
99% of problems with cron are that the environment is minimal and none of your profile is run. Basically you will be running as you, have $HOME setup and that's about it.
# 6  
Old 11-13-2007
Hi Porter.

How do I config enviroment for my case. I run it when I login with root it run okay. I add that script to crontab it cannot run.

Please help me the solution or example. Thanks so much.
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. Shell Programming and Scripting

Cygwin - cannot execute binary file

Hey all, I am using Cygwin on a machine running windows 7 64bits. I am about to use the following command: $ faToTwoBit in.fa out.2bit In the manual on sourceforge it mentioned: "Download blat and faToTwoBit and set the blat_bin and fatotwobit_bin entries in config.txt to the fully... (4 Replies)
Discussion started by: @man
4 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. 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

8. Solaris

How to execute a binary file in solaris?

How to execute a binary file in solaris? I used ./setup.bin . I got the error ./setup.bin not found. (4 Replies)
Discussion started by: agarwal
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. UNIX for Dummies Questions & Answers

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... (5 Replies)
Discussion started by: Tris
5 Replies
Login or Register to Ask a Question