Well, I tried adding the full command path, and set the cron job to
cron.hourly but that didn't work. :-(

The reason I used a cron job (managed by Puppet as a file) was so that
anacron would run the job on reboot if the system was down at 4:00 AM
Sunday. I only need once-a-week running, but I do want to make sure each
week gets its run, whether the machine was running or not.

One thing I'm noticing is my apache2 logs. What does this activity
represent?

127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:07:49 -0400] "PUT
/production/report/system.sys1.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:09:25 -0400] "POST
/production/catalog/weaverex.sys2.com HTTP/1.1" 400 4492 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:09:26 -0400] "PUT
/production/report/weaverex.sys2.com HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:09:35 -0400] "POST
/production/catalog/system.sys3.lan HTTP/1.1" 400 4492 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:09:36 -0400] "PUT
/production/report/system.sys3.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:11:21 -0400] "POST
/production/catalog/system.sys4.lan HTTP/1.1" 400 4492 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:11:22 -0400] "PUT
/production/report/system.sys4.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:12:45 -0400] "POST
/production/catalog/system.sys5.lan HTTP/1.1" 400 4476 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:12:46 -0400] "PUT
/production/report/system.sys6.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:14:55 -0400] "POST
/production/catalog/system.sys7.lan HTTP/1.1" 400 4492 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:14:56 -0400] "PUT
/production/report/system.sys8.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:15:14 -0400] "POST
/production/catalog/system.sys8.lan HTTP/1.1" 400 4492 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:15:15 -0400] "PUT
/production/report/system.sys8.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:17:09 -0400] "POST
/production/catalog/system.sys9.lan HTTP/1.1" 400 4492 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:17:10 -0400] "PUT
/production/report/system.sys9.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:17:45 -0400] "POST
/production/catalog/system.sys10.lan HTTP/1.1" 400 4476 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:17:46 -0400] "PUT
/production/report/system.sys10.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:18:26 -0400] "POST
/production/catalog/system.sys11.lan HTTP/1.1" 400 4492 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:18:27 -0400] "PUT
/production/report/system.sys11.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:19:40 -0400] "POST
/production/catalog/system.sys12.lan HTTP/1.1" 400 4492 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:19:41 -0400] "PUT
/production/report/system.sys12.lan HTTP/1.1" 200 4220 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:19:44 -0400] "POST
/production/catalog/system.sys13.lan HTTP/1.1" 400 4476 "-" "-"
127.0.1.1:8140 <ip_address> - - [19/Apr/2012:19:19:45 -0400] "PUT
/production/report/system.sys13.lan HTTP/1.1" 200 4220 "-" "-


-----Original Message-----
From: puppet-users@googlegroups.com [mailto:puppet-users@googlegroups.com]
On Behalf Of Christopher Wood
Sent: Thursday, April 19, 2012 3:55 PM
To: puppet-users@googlegroups.com
Subject: Re: [Puppet Users] Cron job isn't running

Usually cron problems like this are because of the way cron shrinks your
$PATH environment variable. Read "man 5 crontab" and "man 8 cron", or find
them on the web. Or use the full path to your puppet executable.

Why don't you have puppet set up the cron job for you? That way puppet will
install its own cron job on the first (manual, setup) run and will work
automatically thereafter. Plus if you want to change your run time later,
you need only change your central manifest.

cron { 'run puppet':
  command => "/usr/bin/puppet agent --no-daemonize --onetime",
  user => 'root',
  weekday => 2,
  hour => 1,
  minute => fqdn_rand(59),
}



On Thu, Apr 19, 2012 at 12:43:16PM -0700, thinkwell wrote:
>    I only need to run puppet weekly, so I made this little shell script
and
>    put in the the /etc/cron.weekly folder, but it's not running. If I run
the
>    script manually, it works just fine. Why not from cron?
> 
>    #!/bin/bash
> 
>    #################################
>    # Cron job managed by Puppet
>    #################################
> 
>    # Randomize 15 minutes to avoid overloading server
>    sleep $((RANDOM % 900))
>    exec puppet agent --no-daemonize --onetime
> 
>    --
>    You received this message because you are subscribed to the Google
Groups
>    "Puppet Users" group.
>    To view this discussion on the web visit
>    [1]https://groups.google.com/d/msg/puppet-users/-/Ccx8LJ7QCRMJ.
>    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.
> 
> References
> 
>    Visible links
>    1. https://groups.google.com/d/msg/puppet-users/-/Ccx8LJ7QCRMJ

-- 
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