cancel
Showing results for 
Search instead for 
Did you mean: 

Edit Cron rights for a user

SOLVED
Go to solution
chindi
Respected Contributor

Edit Cron rights for a user

Hi ,

Is it possible that i can give rights for a user cron to be running in it .

But he must not be able to edit  or add any new cron entries ?

 

O.S  hpux 11iv3

5 REPLIES
Dennis Handly
Acclaimed Contributor
Solution

Re: Edit crontab rights for a user

You might be able to allow a user, set up crontab and then remove.

I'm not sure if cron(1m) checks to see if disallowed, if the crontab entry exists.

 

It seems to work fine on 11.23.

Ken Grabowski
Respected Contributor

Re: Edit Cron rights for a user

If you just want a cron job to be run to execute a script or program under a given user ID, without allowing them to add or remove from cron, then you should set up the job under root and use "su useID -c script-or-command-to-execute".   The root user owns the cron job and is the only one that can add, change, or delete the job.  The job will be executed under the name user ID.

chindi
Respected Contributor

Re: Edit crontab rights for a user

Thanks Dennis ,

Tested it on 11.23 and 11.31 , it runs fine.

 

 

 

Dennis Handly
Acclaimed Contributor

Re: Edit Cron rights for a user

>The job will be executed under the name user ID.

 

Hmm, I would think the job runs under root but switches to useID, so the cron mail would go to root.

Ken Grabowski
Respected Contributor

Re: Edit Cron rights for a user

Yes it would.  That may or not be an issue, depending on their requirements.  A well written job will included logging and email alerts/notification aimed at the appropriate individuals.

 

Cron doesn't give you much in the way of features. If your having to enable and then disable a cron user every time they need to add or remove a job, then you might as well own the process and provide a good script wrapped for the applications people to use.  Thats what I've always done, even when a good cross platform job control system was avalable.