LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to execute binary file from cron? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-execute-binary-file-from-cron-690467/)

nirmit 12-14-2008 05:01 AM

How to execute binary file from cron?
 
hi,

i have one binary file.andi want to execute it with crontab

i have placed crontab entry like this:-

00 01 * * * /home/CDR_BACKUP/DetailLocalBackUP.sh Ahmedabad 61.1.32.1 local


and the permission of DetailLocalBackUP.sh is 777
and ownership of the file is oracle:dba

but it is not executing from cron.It is running from the prompt!!!!
i have seen the log then it shoes like this

SESSION OPENED FOR NOBODY
SESSION CLOSED FOR NOBODY



So,please help me to resolve this problem...

Simon Bridge 12-14-2008 05:15 AM

You want to do a backup at 1am every day?
Check how you have set up your cron environment
http://www.adminschoice.com/docs/crontab.htm

*.sh files are not normally binary. By convention, binaries do not have an extension.

nirmit 12-14-2008 05:20 AM

ya... i have written a script andthen convert it into binary file

so should i to remove a extention sh from file.
so does it will run???

Simon Bridge 12-14-2008 06:06 AM

Well you can try - it should not make any difference.
Who is supposed to own the cron session for that program? Root? You? Who?

nirmit 12-15-2008 01:20 AM

root is the owner of that session

Simon Bridge 12-17-2008 06:03 AM

Then log would normally be

SESSION OPENED FOR ROOT

see?

Have you checked your cron environment yet?


All times are GMT -5. The time now is 04:56 PM.