System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

run cron job from another user

 
Son dam bi
Advisor

run cron job from another user

I have a cron job that want to be run by another user id , but this user id do not have permission to run cron job ( I don't want to release it ) , can advise if I want a cron job run as this user id , what can i do ? thx
4 REPLIES
Jupinder Bedi
Respected Contributor

Re: run cron job from another user

make an entry of the user in /var/adm/cron/cron.allow
All things excellent are as difficult as they are rare
Son dam bi
Advisor

Re: run cron job from another user

thx reply ,

I don't want to release it , I want only root have permission to run cron job .

Thx
Johnson Punniyalingam
Honored Contributor

Re: run cron job from another user

so in that case, you can run job by using the root account , you can do has below

Example :-

vi test.sh
su - "/tmp/script/dly.job.sh"



schedule above job under root account crontab

crontab -e
30 * * * 1-5 /home/root/test.sh


Problems are common to all, but attitude makes the difference
AVV
Super Advisor

Re: run cron job from another user

Hi,

If root is able to run cron scripts already, no need to enter the user name to /var/adm/cron/cron.allow since this cron is being executed by root itself but just with the id of another user (??).