![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Run perl file in Crontab error. | raccsdl | Shell Programming and Scripting | 2 | 11-13-2007 07:07 AM |
| Can crontab execute binary files? | Tris | UNIX for Dummies Questions & Answers | 5 | 12-07-2006 02:16 PM |
| Need to execute a complete url from crontab | nissar | Shell Programming and Scripting | 2 | 08-11-2006 05:18 AM |
| compiled binary file gives "cannot execute binary file" | scgupta | SUN Solaris | 0 | 07-13-2006 01:59 AM |
| crontab ..sqlplus cannot execute | zikronz | High Level Programming | 1 | 04-29-2005 10:03 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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. ![]() |
|
||||
|
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 . |
|
||||
|
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. |
|
||||
|
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.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|