SHC Cron help-me


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SHC Cron help-me
# 1  
Old 09-30-2012
Error SHC Cron help-me

Hello, I have some shellscripts internal company more by the need to conceal the code to protect passwords and others, we are using the SHC.

the shellscripts always worked without error, including cron.

after the SHC, if I run manually (. / shellscript) it works

if I put the same command to run in cron, hours works sometimes not.

only in cron does not work ...
already put in / usr / bin / run straight to the command still does not work ... anyone ever had a problem with the SHC? There is another that you can use instead of the SHC?


I'm sure that is not the shell script because without encrypting it runs without errors.


Use the following steps to encrypt.
Code:
shc -r -f


Very thanks!

Last edited by Don Cragun; 03-06-2016 at 04:22 PM.. Reason: Add CODE and ICODE tags.
# 2  
Old 09-30-2012
You need to specify the full path in a crontab
Code:
15 23 * * 1,2,3  /path/to/compiled/shellscript

And it should never be placed in /usr/bin

If this does not help, please post
1. the exact error you are getting
2. your OS
3. your crontab entry
Code:
crontab -l

will give you a listing of your crontab file
# 3  
Old 09-30-2012
my cron

Code:
*/5 * * * * /usr/bin/myshell.x

OS CentOS 6.2


I'll change the folder, something specific? it runs well straight or should I access the folder and run with. / ?

Code:
*/5 * * * * cd /xx/xxx/;   ./myshell.x

?

Thanks

Last edited by Don Cragun; 03-06-2016 at 04:18 PM.. Reason: Add CODE tags.
# 4  
Old 09-30-2012
What Jim said was that you should not put a script which is intended to be executed only by root in /usr/bin. You may place the file somewhere safer, e.g /root/bin etc. I always place the cron scripts in /root/cron directory.

Anyway, please check /var/log/cron file for the error message as to why the script is not getting executed.

Most problems occur due to the PATH environment variable being not set explicitly in the script. It should work in a bash session, but not while executing through cron as it does not set PATH if not explicitly done so in the script.
This User Gave Thanks to admin_xor For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Shc command for hp UNIX 11.23 itanium

(2 Replies)
Discussion started by: sagar_1986
2 Replies

2. Red Hat

shc utility for background jobs

I have used shc utillity to convert a shell script to it's compiled version.Inside this script i have called another shell script which is also in compled version. Example:- Main script:- main.sh.x child script:- child.sh.x (this is called inside main.sh.x) This child script will run in... (2 Replies)
Discussion started by: millan
2 Replies

3. UNIX for Dummies Questions & Answers

Shc on SUN 5.10 SPARC

Hello, I would like to use shc on SUN 5.10 SPARC and HP UX Itanium 11.31 so that I could do some encrypting on my shell scripts. But on these machines I don"t have cc or gcc. I find a man who can download shc.c and send me the binary files. You can download it here : www datsi fi upm es... (3 Replies)
Discussion started by: peg
3 Replies

4. Shell Programming and Scripting

shc compiler issue

I am using the shc shell compiler, it works fine, just that when i execute it, it displays the code at the terminal. Is there any way to hide this as well? otherwise it beats the purpose of hiding the code. Thanks ! (7 Replies)
Discussion started by: ysvsr1
7 Replies

5. Shell Programming and Scripting

Need help - shc

I have two scripts test1.sh and test2.sh. test1.sh is calling test2.sh. test2.sh is having some functions and password which we are using in test1.sh test1.sh #!/bin/sh . test2.sh echo "$test"test2.sh #!/bin/sh test=pravinO/P pravin Now use shc to protect my test2.sh and i modified... (5 Replies)
Discussion started by: pravin27
5 Replies

6. Shell Programming and Scripting

Help with shc

Hi all, I'm trying to install shc on my clean solaris 10 so that I could do some encrypting on my shell scripts. I've tried several ways but it gave me these error messages # make cc -Wall -O6 shc.c -o shc cc: illegal option -Wall *** Error code 1 make: Fatal error: Command failed... (6 Replies)
Discussion started by: solarisnoob
6 Replies

7. Shell Programming and Scripting

Problems using shc

Hi all! First of all, sorry for my poor english :-S Well, I have some scripts in a SuSe server to encrypt... but all them must still working when I encrypt it, ok? About the server, I have root access: # id uid=0(root) gid=0(root) groups=0(root) # uname -a Linux servername... (4 Replies)
Discussion started by: Magius
4 Replies

8. Shell Programming and Scripting

shc usage with octave scripts - HOW ????

Hello there. I would like to know how to use shc (the generic shell script compiler ) with octave scripts. With sh scripts it works fine (because it automatically recognizes the interpreter - here bash ). But when use with octave scripts like this easy one #! /usr/bin/octave disp("testing...")... (0 Replies)
Discussion started by: spiriad
0 Replies

9. Shell Programming and Scripting

How to call the c library created by shc

I have written a shell script called square, which prints the square of the input number, eg. > square 4 16 There is a program called shc which compiles the shell scirpt and create a executable file and a c library file, namely square.x and square.x.c repectively. If I would like to... (0 Replies)
Discussion started by: alfredo
0 Replies

10. Shell Programming and Scripting

shc: shell compiler?

Has anyone ever gotten shc compiler program to work. I am trying to encrypt a bash script on centos. When I run the command "shc -f test.sh", the binary actually gets created; however, when I try to run the binary I get the following the error: # ./test.sh.x ./test.sh.x: No such file or... (1 Reply)
Discussion started by: cstovall
1 Replies
Login or Register to Ask a Question