Operating System - HP-UX
1820057 Members
2930 Online
109608 Solutions
New Discussion юеВ

Re: How to allow a user to use cron?

 
SOLVED
Go to solution
dictum9
Super Advisor

How to allow a user to use cron?


How does one authorize a regular noon-root user to use cron, so he can schedule jobs?

Does it have something to do with permissions, or the group file?
12 REPLIES 12
Pete Randall
Outstanding Contributor

Re: How to allow a user to use cron?

From "man crontab":

"You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use crontab if your name does not appear in the file /usr/lib/cron/cron.deny. If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab."


Pete

Pete
Mark Nieuwboer
Esteemed Contributor
Solution

Re: How to allow a user to use cron?

Hi,

Put the name of the user in the file /var/adm/cron/cron.allow
after that the user can make is own cron file.

But he can't schedule root jobs in his cron.
only jobs he can execute himself.

grtz. Mark
Simon Wickham_6
Regular Advisor

Re: How to allow a user to use cron?

Hi,

You will have a asccii file called cron.allow which is located under /var/adm/cron. Simply add the user to this and they will be able to created cron jobs.

Regards,
Simon
Jakes Louw
Trusted Contributor

Re: How to allow a user to use cron?

Yeah, definitely /var/adm/cron/cron.allow
Trying is the first step to failure - Homer Simpson
Arunvijai_4
Honored Contributor

Re: How to allow a user to use cron?

Hi etc,

Edit /var/adm/cron/cron.allow, add your user there.

Also, take your time to assign points to the people who spent time and responded to your question.

http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA1282552&listType=unassigned&forumId=1

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Cem Tugrul
Esteemed Contributor

Re: How to allow a user to use cron?

Hi,
An example from my /var/adm/cron/cron.allow
file;
baan01:/#cat /var/adm/cron/cron.allow
root
adm
uucp
rvs
baycom
ae1820

so my extra users like rvs,baycom,ae1820
can handle their own cron jobs!!!

Hope this helps you!!!

Good Luck,

Ps:Please Do not forget to submit points!
:-)
Our greatest duty in this life is to help others. And please, if you can't
dictum9
Super Advisor

Re: How to allow a user to use cron?


Do I need to restart the cron process? (i.e. kill -HUP pid)


Thanks, and I will submit points.
James R. Ferguson
Acclaimed Contributor

Re: How to allow a user to use cron?

Hi:

No, you do not need to restart 'cron' after editting the 'cron.allow' or 'cron.deny' files.

You may also want to setup the same user's in 'at.allow' and 'at.deny' at you do for cron. It is often very convienent for a user to first test with 'at'. See the manpages for 'at(1)' for more information.

Regards!

...JRF...
rariasn
Honored Contributor

Re: How to allow a user to use cron?

Hi,

Edit /var/adm/cron/crontab.allow a insert new user. Example:

# cat /var/adm/cron/crontab.allow
root
user1

Next, create crontab file for "user1"

# crontab -e user1

and insert commands.

Verify,

# cat /var/spool/cron/crontabs/user1

Regards,

Muthukumar_5
Honored Contributor

Re: How to allow a user to use cron?

When you enter user name in /usr/lib/cron/cron.allow, user is able to use crontab. Or If you are having a file of /usr/lib/cron/cron.deny without any entry then all users are allowed.

No need for restarting cron service. It will lookup those files during crontab execution only.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: How to allow a user to use cron?

Hello,

Have a look at this document, It should help you to understand about cron and at.

http://docs.hp.com/en/B2355-90164/apcs01.html

Using HP-UX > Appendix C. Scheduling Commands
Running Commands at Preset Times

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arturo Galbiati
Esteemed Contributor

Re: How to allow a user to use cron?

Hi,
man crontab:

"You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use crontab if your name does not appear in the file /usr/lib/cron/cron.deny. If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab."

HTH,
Art