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.

Reply via email to