Operating System - Linux
1757034 Members
2204 Online
108858 Solutions
New Discussion юеВ

Re: shutting down CRON for specific user.

 
SOLVED
Go to solution
Jim Tropiano_1
Frequent Advisor

shutting down CRON for specific user.

We have a cron for root and and cron for oracle and a cron for selected users. How can I just shutdown the cron for oracle while leaving the rest up and how would I start it back up manually.

I know that I could shutdown all the crons by run the cron script in /sbin/init.d and giving the stop or start parameter.
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: shutting down CRON for specific user.

Make an entry in /usr/lib/cron/cron.deny.


Pete

Pete
James R. Ferguson
Acclaimed Contributor
Solution

Re: shutting down CRON for specific user.

Hi Jim:

To shutdown 'cron' for a specific user,
simply remove the user's crontab:

# su - oracle
# crontab -l > ${HOME}oracle_crontab
# crontab -r

To restart (later):

# su - oracle
# crontab ${HOME}oracle_crontab

Regards!

...JRF...
Jim Tropiano_1
Frequent Advisor

Re: shutting down CRON for specific user.

Thank up for that little bit of information. That is what I was somewhat thinking of doing but wanted to see if there was and easier way. I will test that out.

Thanks again.
Steven E. Protter
Exalted Contributor

Re: shutting down CRON for specific user.

Jim,

What you have been given is the standard and easy way.

By default cron should be denied for all users and permitted for those users that need it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: shutting down CRON for specific user.

Hi (again) Jim:

Adding your user's login to the 'cron.deny' file isn't going to disable crontasks that are otherwise allowed and already in place.

Quoting from the 'crontab' manpages:

/* Begin_Quote */

You can execute crontab if your name appears in the file /var/adm/cron/cron.allow. If that file does not exist, you can use crontab if your name does not appear in the file /var/adm/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.

/* End_Quote */

Regards!

...JRF...
Jim Tropiano_1
Frequent Advisor

Re: shutting down CRON for specific user.

I just did not want to change the crontab.allow or crontab.deny files. I n case someone for got to modifiy the file when done. I am just going to remove the crontab and leave it empty and then when the process is complete I am going to put the crontab back .