Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was given a task to create a cron which finds, kills and clears old puppet runs that were not successfully installed.

I am more or less looking for a starting point.

share|improve this question
up vote 0 down vote accepted


In your cron job:

if [[ "$(uname)" = "Linux" ]];then killall --older-than 30m,1h puppet;fi

Do not attempt to run this or write this on Solaris systems. If you have Solaris systems in your infrastructure as a mixed Linux/Solaris environment, just walk away from this answer entirely.

The man pages have more documentation on the date format for killall, if you're running GNU userland.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.