LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-17-2013, 02:06 AM   #1
jaskiratsinghjassi
LQ Newbie
 
Registered: May 2013
Posts: 3

Rep: Reputation: Disabled
Problems running a script (converted to binary executable) from crontab


Hi,

I am also facing the same problem as in http://www.linuxquestions.org/questi...om-cron-690467

when i make entry in crontab as:-

00 06 * * * . /oracle/scripts/test.sh </dev/null >/dev/null 2>/dev/null

it will execute successfully.

when i convert it into binary file:-

00 06 * * * . /oracle/scripts/test </dev/null >/dev/null 2>/dev/null

It Failed.

Can you please help with this also.

Thanks is advance.

Last edited by colucix; 05-19-2013 at 11:27 AM. Reason: Added reference to (old) thread from which this one has been pruned.
 
Old 05-17-2013, 02:23 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by jaskiratsinghjassi View Post
Hi,
Welcome to LQ;
Quote:
I am also facing the same problem.

when i make entry in crontab as:-

00 06 * * * . /oracle/scripts/test.sh </dev/null >/dev/null 2>/dev/null

it will execute successfully.

when i convert it into binary file:-

00 06 * * * . /oracle/scripts/test </dev/null >/dev/null 2>/dev/null

It Failed.

Can you please help with this also.

Thanks is advance.
That was quite a while ago... let's see:
Have you read through the thread and followed the advise there already?
Will the binary execute OK from the commandline?
Have you looked through the logs to see what they say?
If you don't suppress the output messages, what do they say?
 
Old 05-17-2013, 03:17 AM   #3
jaskiratsinghjassi
LQ Newbie
 
Registered: May 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the quick reply.

yes, binary file execute very well as "./oracle/scripts/test"
cron user is oracle.
all the environment variables are ok as "/oracle/scripts/test.sh" run through crontab very well.
Logs for failure that i know is at "/var/adm/cron/log" where is can see "FAILED" or "SUCCESSFUL".
and its SUCCESSFUL for test.sh but FAILED for test(binary file)
I don't know any other Logs of cron jobs.

Please suggest.
 
Old 05-17-2013, 03:34 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Quote:
/var/adm/cron/log
Is this Solaris?
 
Old 05-17-2013, 03:34 AM   #5
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
You piped the outputs in the execute command - you could try piping them to a text file and then reading the file?
You should check your loglevel for cron - set it to 15.

Did you check the other suggestions in the rest of this thread?

What is the output of:
ls /oracle/scripts/test -l

Note: from cron(8)
cron logs its action to the syslog facility 'cron', and logging may be controlled using the standard syslogd(8) facility.

[aside: I don't have a log at /var/adm/cron/log ... so, supplimental to chrism01's question: what is the system?]

Last edited by Simon Bridge; 05-17-2013 at 03:35 AM.
 
Old 05-19-2013, 11:28 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
I notice that in your original crontab entry
Code:
00 06 * * * . /oracle/scripts/test.sh </dev/null >/dev/null 2>/dev/null
the script is not executed, but "sourced" using the . (dot) command. Then it appers you retained the same syntax after having converted the script to binary:
Code:
00 06 * * * . /oracle/scripts/test </dev/null >/dev/null 2>/dev/null
Is this a typo in your post or might it be the reason for which the cron job fails? If this is the case, what happens if you remove the dot from the crontab entry? Does it work?

Last edited by colucix; 05-19-2013 at 11:30 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
convert shell script to a binary executable madhi Programming 13 07-24-2012 10:36 AM
Can we call a C function or C executable binary from Shell script? tanniru Programming 3 10-14-2011 09:49 AM
Will changes in Java binary executable affect running Java programs? xuancong Programming 6 04-14-2011 02:04 AM
[SOLVED] Running Executable in Bash Script Duo11 Linux - General 4 03-28-2011 02:46 AM
rc.modules converted to binary? gani Slackware 7 09-08-2004 09:57 PM


All times are GMT -5. The time now is 09:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration