Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to stop all cronjobs for a particular cpanel user? The cronjobs should be resumable when required later.

There are several hundred cronjobs running under this user. Only this user's cronjobs should be paused/suspended.

share|improve this question
1  
See the options at: serverfault.com/questions/94351/… –  ewwhite Sep 16 '12 at 21:33
    
I have several hundred cronjobs, it takes some time to manually comment and uncomment the lines. /etc/init.d/crond stop is not suitable as that will stop the cronjobs of all users, I just need to stop cronjobs of a user. –  Nyxynyx Sep 16 '12 at 21:48
add comment

1 Answer 1

up vote 2 down vote accepted

I think there is a cleaner way :

According to centos documentation , you can use /etc/cron.allow and /etc/cron.deny to achieve this.

However, these file are os dependent (I assume you are using centos/redhat from the tags of your question).

Though, in newer versions this has stopped working.

share|improve this answer
    
That only controls access to the crontab, it does not stop the existing cronjobs from running. You have to rename the crontab file: superuser.com/a/675338/190858 –  Perleone Nov 13 '13 at 9:53
    
Yes it does : If you add a user to /etc/cron.deny, no more cronjob will be started for this user. Have you tried the solution? What problem did you encounter? –  Eric DANNIELOU Nov 13 '13 at 10:21
    
No problem, just wanted to clarify. With Ubuntu 12.04.3 LTS an entry in /etc/cron.deny only prevents the user from accessing her crontab, as stated in the man page. "You (user) are not allowed to use this program (crontab). See crontab(1) for more information." The cron daemon itself does not care about cron.deny. Does CentOS handle that differently, or is it a cpanel feature? –  Perleone Nov 13 '13 at 11:29
    
You are right : Can't get it working anymore and redhat has changed for cronie. I flagged it as outdated. I wasn't aware about ubuntu using cron.deny and cron.allow –  Eric DANNIELOU Nov 13 '13 at 13:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.