Operating System - HP-UX
1747988 Members
4969 Online
108756 Solutions
New Discussion юеВ

Re: cronjob not workin for non-root user

 
Jenny John
Advisor

cronjob not workin for non-root user

my cronjob for non-root user was working fine before the restart of the server but after the restart cronjob for non-root user is not working.
12 REPLIES 12
Hakki Aydin Ucar
Honored Contributor

Re: cronjob not workin for non-root user

You got this message when you check via the user account you mentioned:
# crontab -l
crontab: you are not authorized to use cron. Sorry.

You check the /var/adm/cron/cron.allow file,it is probably empty. The you have to put the user name inside the file to allow cronjob.
Jenny John
Advisor

Re: cronjob not workin for non-root user

crontab -l is working
and my user is added in cron.allow file
Hakki Aydin Ucar
Honored Contributor

Re: cronjob not workin for non-root user

did you check the cron logs ? under /var/adm/cron
Jenny John
Advisor

Re: cronjob not workin for non-root user

yes but i didnt find any error over there

my script is running manually & root users cron is running fine

is there any other file to check the cron log for specified user other than root
Dennis Handly
Acclaimed Contributor

Re: cronjob not workin for non-root user

How do you know it isn't working? What do you expect to happen?
Expect mail? Expect an action in a disk file?

>is there any other file to check the cron log

Not really. Have you checked /var/adm/syslog/mail.log?
Have you done a "crontab -e" to make sure cron(1m) knows there is a change?

I assume there is a file in /var/spool/cron/crontabs/ for that user?
Jenny John
Advisor

Re: cronjob not workin for non-root user

actually my script is collecting system stats.. which runs at every 5 mins and the ouput is redirected to a file which is not being updated... but when i run the script manually its working fine.

i have tried crontab -e also..
is there anything else i have to check??
Dennis Handly
Acclaimed Contributor

Re: cronjob not workin for non-root user

>I didn't find any error over there

Do you see your script even being invoked by cron(1m)?

You should see:
> CMD: your crontab line
> username 2910 c Sun Jul 18 13:23:00 PDT 2010
< username 2910 c Sun Jul 18 13:23:16 PDT 2010

The last two are start and stop times.
If you see an entry, you need to debug your script.
Jenny John
Advisor

Re: cronjob not workin for non-root user

i dont see my script even being invoked by cron(1m).
Dennis Handly
Acclaimed Contributor

Re: cronjob not workin for non-root user

>I don't see my script even being invoked by cron(1m).

Restart cron?
/sbin/init.d/cron stop
/sbin/init.d/cron start