-2

I have the following issue that all of my cronjobs are running twice.

When I do:

ps aux | grep cron

I see the following:

root      1379  0.0  0.1 117296  1224 ?        Ss   Aug26   0:00 crond
root     17177  0.0  0.0 103248   860 pts/0    S+   10:42   0:00 grep cron

Two instances. The last one recreates each minute, so you can see time is currently 10:42 am over here. Each minute the instances gets killed and a new one starts with new pid.

Is it here the problem is? How can I solve this?

I am using CentOS 6.

3
  • 2
    Where do you see two instances of crond? The output you posted shows only one. Aug 27, 2015 at 8:57
  • If you want suppress grep in the output you should do ps aux | grep cron | grep -v grep Aug 27, 2015 at 9:00
  • I'm voting to close this question as off-topic because it's basically a misread of the grep output. meta.serverfault.com/a/6160/174813 Aug 29, 2015 at 20:48

1 Answer 1

1

when you do ps aux | grep cron you are running two commands - ps aux and grep cron. ps aux lists all processes currently running, and grep cron matches any lines which contain "cron" in them.

Obviously the crond process matches the word cron, but so does the grep cron process you just ran. It's matching itself recursively.

Not the answer you're looking for? Browse other questions tagged .