Take the 2-minute tour ×
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.

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

1 Answer

up vote 0 down vote accepted

**THIS IS NOT PORTABLE TO SOLARIS**

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

Your Answer

 
discard

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.