Build periodically after schedule (disble running on system startup)

Hi. How do I disable delaying schedules? When a computer is turned on after hibernation, it becomes very sluggish. It seems all scheduled tasks that were missed are getting executed.

My setup for a projects-up job: Build periodically: H H(11-12) * * 1-5.

When I turn the computer on at say… 16:00, I do not want the task to be executed. So basically, I want it to run as classic cron, not as anacron.

I’ve solved it using System Groovy Step:

import hudson.model.Cause
import hudson.model.AbstractBuild

def cause = build.getCause(Cause.UserIdCause.class)
if (cause != null) {
	println("Skipping hour check. This build was started by user: " + cause.getUserName())
} else {
	// Get the current hour
	def hour = new Date().format('H', TimeZone.getDefault())
	int hourInt = Integer.parseInt(hour)

	// Check if time is outside of designed hours
	if (hourInt < 14 || hourInt > 15) {
		println "Current hour is $hourInt. It is outside the scheduled time window. Exiting job."
		throw new InterruptedException();
	}
}