Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running cron jobs as specific users

Status
Not open for further replies.

biot023

Programmer
Nov 8, 2001
403
0
0
GB
Hallo.
I have a number of scripts I have written that I would like to run with cron, but they often need to be run by specific users (vision & oracle).
Is it possible to set these to be run as specific users?
& how would I do that?
Any & all help gratefully received.
Douglas JL

A salesman is a machine for turning coke into obnoxious arrogance.

Common sense is what tells you the world is flat.

 
I would try to 'su - <desired user>' while root, then 'crontab -e'. You would have to add that user to your cron.allow file too.

Giving a database or service-running user more ability to run commands on the system may not be desireable either. Maybe a long command like '/bin/su -l <user> -c <put the command to run as the other user>'.

----
JBR
 
or add user name in
/var/adm/cron/cron.allow and
login as user and setup cron
crontab -e

Patel
 
use : crontab -u username -e
Note : users should have right to access the program/applications.
Or run the program/applications through sudo command on crontab.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top