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.

My cron suddenly stopped working. Output of ps -A | grep cron:

3149 ? 00:00:00 cron

I have no idea how to interpret that. The only thing I can think of that I did wrong was I chmod 777 my cron files (so I could edit them as non-root)....does that matter (if so, how do I change it back to where it is by default)?

thanks

UPDATE: Here is the full cron file:

DO NOT EDIT THIS FILE - edit the master and reinstall.

(/tmp/crontab.XXXXDzXgEa installed on Sat Feb 19 08:24:00 2011)

(Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)

MAILTO="me@mail.com"

*/1 * * * 1-5 /usr/bin/perl /myscripts/master.pl 2>&1

share|improve this question
    
what do you try to run? print the line from your crontab file. –  Stony Mar 31 '11 at 14:07

1 Answer 1

up vote 2 down vote accepted

I would highly suggest that you chmod your cron files back to the defaults (which is 600 for all files, user and group root for the root crontab, and the owner of the file and private group for all others). For example, my root crontab (on CentOS) owned by user root and group root, and my personal crontab file is user malcolm and group malcolm.

I'm not entirely sure if cron checks the permissions (I hope it does), but leaving this open is really not good - it would allow anyone who got access to your system in any way to run processes as other users, and even root.

If you need to be able to allow other users to edit the root crontab, I suggest you use sudo to grant that access, and only grant it to trusted users.

share|improve this answer
    
I changed it to 600 but cron is still not executing –  user70981 Mar 31 '11 at 14:19
1  
Try restarting the crond service. Not sure what OS you're using, but it should be something like "/etc/init.d/crond restart" –  malcolmpdx Mar 31 '11 at 14:27
    
got it working. thanks for your help! –  user70981 Mar 31 '11 at 14:44

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.