Operating System - HP-UX
1752770 Members
4672 Online
108789 Solutions
New Discussion юеВ

Re: crontab permission denied

 
SOLVED
Go to solution
noe
Occasional Advisor

crontab permission denied

hi all
when i try to run a .sh as root i get the following error:
sh: /var/adm/mytest.sh: Execute permission denied.
any ideas?
thanks
8 REPLIES 8
Mel Burslan
Honored Contributor

Re: crontab permission denied

chmod u+x /var/adm/mytest.sh

this should solve your problem
________________________________
UNIX because I majored in cryptology...
noe
Occasional Advisor

Re: crontab permission denied

thanks i will try it tonight
avizen9
Esteemed Contributor
Solution

Re: crontab permission denied

hello noe,

if you want to run any script thorugh any txt file that file should have execute permission.

before execute that tax file (.sh) you should check it with ls -altr command

you can use chmod +x to make it executable.
below is one executable file example, thanks,
-rwxr-xr-x 1 root root 5 May 20 10:44 arv
Suraj K Sankari
Honored Contributor

Re: crontab permission denied

Hi,
>>sh: /var/adm/mytest.sh: Execute permission denied
As Mel said you need to set your file permission executable then only you can run the script.
there are 2 way to set file permission
1.symbolic_mode_list
2.numeric_mode

Make a file executable by everybody:
chmod a+x file

chmod 111 file

For more see man page of chmod

Suraj
noe
Occasional Advisor

Re: crontab permission denied

thanks all, i changed permission to be executable it works now
avizen9
Esteemed Contributor

Re: crontab permission denied

Hello Noe,
glad to hear that it works, appriciate if you can assign points who has contribute here, thanks,
Suraj K Sankari
Honored Contributor

Re: crontab permission denied

Hi,

Nice to here that your problem got solved but make a habit to assign some points who give there valuable time for your problem.

To know how to assign points please go through the below link.


http://forums13.itrc.hp.com/service/forums/helptips.do?#33

Suraj
Tirtha
Occasional Advisor

Re: crontab permission denied

Hi

For execute any file u need to give that file the permision.

eg.
#chmod 777

It will give the full permision to that file.