tags:

views:

497

answers:

3

Hi, I have set the cron tab for my site. But I have got message in my mailing id like this "Permission denied" for the script. Can anyone help me telling what may be the problem.

Thanks......

+2  A: 

I can specify a seperate cronfile for each avaible user. So, you can add a new user (adduser), give that user special permissions and and run your script in that user cronfile.

Reference Crontab Manual

Henrik P. Hessel
To expand on this: crontab's are per user. So make sure the user whose crontab you have edited has execute rights on the script.
Colin Fine
That's correct. Thanks Colin. As stated in the manual you can edit users cronfiles with crontab -e username
Henrik P. Hessel
+2  A: 

You get this error while setting the crontab? or from a script running from the cron?

If while setting the crontab, try this:

You type: crontab -e You get: -bash: /usr/bin/crontab: Permission denied

Problem: Your user is not in the cron group.

Solution: As root, edit the /etc/group file, find the cron group and add your user to that line (the usernames are comma-separated). Then re-login as your user.

Verify: Run command "groups". You should see "cron" in there.

(from http://www.parseerror.com/argh/crontab-e-Permission-denied.txt)

Colin Pickard
A: 

friends if any one wants schedule crons from other user just do this

root user:-

ls /usr/bin/crontab chmod 4755 /usr/bin/crontab

echo PATH vi /etc/crontab

SHELL=/bin/bash PATH=/usr/java/jdk1.5.0_22/bin:/root/bin:/usr/java/jdk1.5.0_22/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin MAILTO=root HOME=/

cd /etc/cron.d

create cron.allow file if not exist

vi cron.allow root other username

save and exist

su – username /usr/bin/crontab -e

schedule here ……………….

i hope this may help u friends

by Ravi Reddy

ravi