Hi Nan,

thanks. I have removed the schedule (re)definition but it does still the same - 
the tidy is called on every run (every 30 minutes). the state.yaml after a 
typical run has following records:

* puppet log:

Jan 24 10:37:32 puppet puppet-agent[24504]: 
(/Stage[main]/Puppet::Master/Tidy[/var/lib/puppet/reports]) Tidying 
File[/var/lib/puppet/reports/puppet/201101171031.yaml]
Jan 24 10:37:32 puppet puppet-agent[24504]: 
(/Stage[main]/Puppet::Master/Tidy[/var/lib/puppet/reports]) Tidying 
File[/var/lib/puppet/reports/server1/201101171032.yaml]
Jan 24 10:37:32 puppet puppet-agent[24504]: 
(/Stage[main]/Puppet::Master/Tidy[/var/lib/puppet/reports]) Tidying 
File[/var/lib/puppet/reports/server2/201101171035.yaml]
Jan 24 10:37:33 puppet puppet-agent[24504]: 
(/File[/var/lib/puppet/reports/server1/201101171032.yaml]/ensure) removed
Jan 24 10:37:36 puppet puppet-agent[24504]: 
(/File[/var/lib/puppet/reports/puppet/201101171031.yaml]/ensure) removed
Jan 24 10:37:36 puppet puppet-agent[24504]: 
(/File[/var/lib/puppet/reports/server2/201101171035.yaml]/ensure) removed

* state.yaml:

  "Tidy[/var/lib/puppet/reports]": 
    !ruby/sym checked: 2011-01-24 00:49:51.861210 +00:00
  "File[/var/lib/puppet/reports/puppet/201101171031.yaml]": 
    !ruby/sym synced: 2011-01-24 10:37:36.589507 +00:00
    !ruby/sym checked: 2011-01-24 10:37:36.583191 +00:00
  "File[/var/lib/puppet/reports/server1/201101171032.yaml]": 
    !ruby/sym synced: 2011-01-24 10:37:33.482278 +00:00
    !ruby/sym checked: 2011-01-24 10:37:33.476454 +00:00
  "File[/var/lib/puppet/reports/server2/201101171035.yaml]": 
    !ruby/sym synced: 2011-01-24 10:37:36.737558 +00:00
    !ruby/sym checked: 2011-01-24 10:37:36.730387 +00:00

so as I understand it the state.yaml file says the 
Tidy[/var/lib/puppet/reports] 
was run at 00:49 so I would expect it won't be called this day again but as the 
logs show several files are tidied on each run anyway.

what's wrong?

thanks Antony.



________________________________
From: Nan Liu <n...@puppetlabs.com>
To: puppet-users@googlegroups.com
Sent: Fri, 21 January, 2011 18:08:24
Subject: Re: [Puppet Users] scheduler problem?

On Fri, Jan 21, 2011 at 7:49 AM, Antony Mayi <antonym...@yahoo.com> wrote:
> Hi,
> I am trying to cleanup the puppet reports on the master by puppet itself
> using the tidy type however want to run it once a day not every 30 minutes.
> I would expect following code does the trick:
> schedule { daily:
>   period => daily,
> }
> tidy { "/var/lib/puppet/reports":
>   age => "1w",
>   recurse => true,
>   matches => "*.yaml",
>   schedule => daily
> }
> however it runs still every 30 minutes and I am getting huge report of
> tidied logs every half an hour.
> what am I doing wrong? how can I change the scheduler for this job to be run
> only once a day?

Schedule daily appears to be something that's already defined in
puppet, so I would use a different title.

Do you get a log of the event in your state.yaml? For example:

schedule {
  once:
  period => daily,
}

exec {
  "/bin/date > /tmp/time":
    schedule => once,
}

/var/lib/puppet/state/state.yaml:
  "Exec[/usr/bin/date > /tmp/time]":
    !ruby/sym checked: 2011-01-21 20:23:33.869328 -05:00
    !ruby/sym synced: 2011-01-21 20:23:33.870815 -05:00

So in your case, you should have something along the line of:
  "Tidy[/var/lib/puppet/reports]":
    !ruby/sym checked: 2011-01-21 20:33:17.927550 -05:00

Thanks,

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.


      

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to