# Duplicate cron entries?

**URL:** <https://discourse.chef.io/t/duplicate-cron-entries/1505>\
**Category:** Chef Infra (archive)\
**Created:** [August 20, 2010, 4:35pm UTC](https://discourse.chef.io/t/duplicate-cron-entries/1505 "2010-08-20T16:35:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Choi](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@Paul\_Choi](https://discourse.chef.io/u/Paul_Choi)\
**Post date:** [August 20, 2010, 4:35pm UTC](https://discourse.chef.io/t/duplicate-cron-entries/1505/1 "2010-08-20T16:35:28Z")

</div>

Hello,

I’m running chef-client 0.9.6 on a bunch of hosts and occasionally,  
duplicate entries show up:

# Chef Name: findcore

0 \*/2 \* \* \* /usr/local/bin/findcore.sh

# Chef Name: delete\_cores

30 1 \* \* \* find /var/log/archives/core/\* -type d -mtime +3 -exec rm -rf  
{} ;

# Chef Name: findcore

0 \*/2 \* \* \* /usr/local/bin/findcore.sh

Unfortunately, I’m chef-client on log\_level :info…, so this is all I  
see in the logs:  
[Thu, 19 Aug 2010 23:45:21 -0700] INFO: Added cron ‘findcore’

There’s approx. 15 hosts running the same run\_list and it pops up once a  
day on a totally random host. I just upgraded to 0.9.6 from 0.8.16,  
although I was seeing this in 0.8.16 also. Any ideas?

-Paul Choi

---

<div class="post-metadata">

**Author:** ![Paul\_Choi](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@Paul\_Choi](https://discourse.chef.io/u/Paul_Choi)\
**Post date:** [August 20, 2010, 5:11pm UTC](https://discourse.chef.io/t/duplicate-cron-entries/1505/2 "2010-08-20T17:11:39Z")

</div>

I just deleted /var/spool/cron/root, then re-ran chef-client in debug.

[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[findcore] on  
[w17.plaxo.com](http://w17.plaxo.com)[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[findcore]  
using Chef::Provider::Cron[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron  
empty for 'root'  
[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron 'findcore'  
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[delete\_cores]  
on [w17.plaxo.com](http://w17.plaxo.com)  
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[delete\_cores] using  
Chef::Provider::Cron  
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron 'delete\_cores' not  
found[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron 'delete\_cores'

Then you get:

# Chef Name: findcore

0 \*/2 \* \* \* /usr/local/bin/findcore.sh

# Chef Name: delete\_cores

30 1 \* \* \* find /var/log/archives/core/\* -type d -mtime +3 -exec rm -rf  
{} ;

which is correct.

I guess I'll leave it in debug for a while...

-Paul

On 8/20/10 9:35 AM, Paul Choi wrote:

> Hello,
> 
> I'm running chef-client 0.9.6 on a bunch of hosts and occasionally,  
> duplicate entries show up:
> 
> # Chef Name: findcore
> 
> 0 \*/2 \* \* \* /usr/local/bin/findcore.sh
> 
> # Chef Name: delete\_cores
> 
> 30 1 \* \* \* find /var/log/archives/core/\* -type d -mtime +3 -exec rm  
> -rf {} ;
> 
> # Chef Name: findcore
> 
> 0 \*/2 \* \* \* /usr/local/bin/findcore.sh
> 
> Unfortunately, I'm chef-client on log\_level :info..., so this is all I  
> see in the logs:  
> [Thu, 19 Aug 2010 23:45:21 -0700] INFO: Added cron 'findcore'
> 
> There's approx. 15 hosts running the same run\_list and it pops up once  
> a day on a totally random host. I just upgraded to 0.9.6 from 0.8.16,  
> although I was seeing this in 0.8.16 also. Any ideas?
> 
> -Paul Choi

---

<div class="post-metadata">

**Author:** ![Erik\_Kastner](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/erik_kastner/32/882_2.png) [@Erik\_Kastner](https://discourse.chef.io/u/Erik_Kastner)\
**Post date:** [August 20, 2010, 6:14pm UTC](https://discourse.chef.io/t/duplicate-cron-entries/1505/3 "2010-08-20T18:14:09Z")

</div>

I ran into this a little while back. the issue is (was?) the regular expression used for searching the cron list.

it would mistakenly try to re add existing crons. I'll take a look later and see if it's fixed now.

Sent from my iPhone

On Aug 20, 2010, at 1:11 PM, Paul Choi [paulchoi@plaxo.com](mailto:paulchoi@plaxo.com) wrote:

> I just deleted /var/spool/cron/root, then re-ran chef-client in debug.
> 
> [Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[findcore] on [w17.plaxo.com](http://w17.plaxo.com)[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[findcore] using Chef::Provider::Cron[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron empty for 'root'  
> [Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron 'findcore'  
> [Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[delete\_cores] on [w17.plaxo.com](http://w17.plaxo.com)  
> [Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[delete\_cores] using Chef::Provider::Cron  
> [Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron 'delete\_cores' not found[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron 'delete\_cores'
> 
> Then you get:
> 
> # Chef Name: findcore
> 
> 0 \*/2 \* \* \* /usr/local/bin/findcore.sh
> 
> # Chef Name: delete\_cores
> 
> 30 1 \* \* \* find /var/log/archives/core/\* -type d -mtime +3 -exec rm -rf {} ;
> 
> which is correct.
> 
> I guess I'll leave it in debug for a while...
> 
> -Paul
> 
> On 8/20/10 9:35 AM, Paul Choi wrote:
> 
> > Hello,
> > 
> > I'm running chef-client 0.9.6 on a bunch of hosts and occasionally, duplicate entries show up:
> > 
> > # Chef Name: findcore
> > 
> > 0 \*/2 \* \* \* /usr/local/bin/findcore.sh
> > 
> > # Chef Name: delete\_cores
> > 
> > 30 1 \* \* \* find /var/log/archives/core/\* -type d -mtime +3 -exec rm -rf {} ;
> > 
> > # Chef Name: findcore
> > 
> > 0 \*/2 \* \* \* /usr/local/bin/findcore.sh
> > 
> > Unfortunately, I'm chef-client on log\_level :info..., so this is all I see in the logs:  
> > [Thu, 19 Aug 2010 23:45:21 -0700] INFO: Added cron 'findcore'
> > 
> > There's approx. 15 hosts running the same run\_list and it pops up once a day on a totally random host. I just upgraded to 0.9.6 from 0.8.16, although I was seeing this in 0.8.16 also. Any ideas?
> > 
> > -Paul Choi

---

<div class="post-metadata">

**Author:** ![Erik\_Kastner](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/erik_kastner/32/882_2.png) [@Erik\_Kastner](https://discourse.chef.io/u/Erik_Kastner)\
**Post date:** [August 21, 2010, 5:19pm UTC](https://discourse.chef.io/t/duplicate-cron-entries/1505/4 "2010-08-21T17:19:11Z")

</div>

The bug I had noticed has been fixed. I ran my tests on 0.9.8 and all is well 🙂

On Fri, Aug 20, 2010 at 2:14 PM, Erik Kastner [kastner@gmail.com](mailto:kastner@gmail.com) wrote:

> I ran into this a little while back. the issue is (was?) the regular expression used for searching the cron list.
> 
> it would mistakenly try to re add existing crons. I'll take a look later and see if it's fixed now.
> 
> Sent from my iPhone
> 
> On Aug 20, 2010, at 1:11 PM, Paul Choi [paulchoi@plaxo.com](mailto:paulchoi@plaxo.com) wrote:
> 
> > I just deleted /var/spool/cron/root, then re-ran chef-client in debug.
> > 
> > [Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[findcore] on [w17.plaxo.com](http://w17.plaxo.com)[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[findcore] using Chef::Provider::Cron[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron empty for 'root'  
> > [Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron 'findcore'  
> > [Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[delete\_cores] on [w17.plaxo.com](http://w17.plaxo.com)  
> > [Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[delete\_cores] using Chef::Provider::Cron  
> > [Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron 'delete\_cores' not found[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron 'delete\_cores'
> > 
> > Then you get:
> > 
> > # Chef Name: findcore
> > 
> > 0 \*/2 \* \* \* /usr/local/bin/findcore.sh
> > 
> > # Chef Name: delete\_cores
> > 
> > 30 1 \* \* \* find /var/log/archives/core/\* -type d -mtime +3 -exec rm -rf {} ;
> > 
> > which is correct.
> > 
> > I guess I'll leave it in debug for a while...
> > 
> > -Paul
> > 
> > On 8/20/10 9:35 AM, Paul Choi wrote:
> > 
> > > Hello,
> > > 
> > > I'm running chef-client 0.9.6 on a bunch of hosts and occasionally, duplicate entries show up:
> > > 
> > > # Chef Name: findcore
> > > 
> > > 0 \*/2 \* \* \* /usr/local/bin/findcore.sh
> > > 
> > > # Chef Name: delete\_cores
> > > 
> > > 30 1 \* \* \* find /var/log/archives/core/\* -type d -mtime +3 -exec rm -rf {} ;
> > > 
> > > # Chef Name: findcore
> > > 
> > > 0 \*/2 \* \* \* /usr/local/bin/findcore.sh
> > > 
> > > Unfortunately, I'm chef-client on log\_level :info..., so this is all I see in the logs:  
> > > [Thu, 19 Aug 2010 23:45:21 -0700] INFO: Added cron 'findcore'
> > > 
> > > There's approx. 15 hosts running the same run\_list and it pops up once a day on a totally random host. I just upgraded to 0.9.6 from 0.8.16, although I was seeing this in 0.8.16 also. Any ideas?
> > > 
> > > -Paul Choi
