Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scheduled_task - Repeat triggers
scheduled_task { 'Notepad_normal':
ensure => 'present',
enabled => 'true',
command => 'C:\Windows\notepad.exe',
trigger => { 'every' => '1', 'schedule' => 'daily', 'start_time' => '15:10' },
user => 'system',
}
scheduled_task { 'Notepad_with_startdate':
ensure => 'present',
enabled => 'true',
command => 'C:\Windows\notepad.exe',
trigger => { 'every' => '1', 'schedule' => 'daily', 'start_time' => '15:16', 'start_date' => '1999-01-01' },
user => 'system',
}
scheduled_task { 'Weekly Task':
ensure => present,
command => 'C:\Windows\System32\cmd.exe',
trigger => {
schedule => weekly,
start_time => '07:30',
day_of_week => [mon, tues, wed, thurs, fri],
},
}
scheduled_task { 'Notepad_daily_repeat':
ensure => present,
command => 'C:\Windows\notepad.exe',
trigger => {
schedule => daily,
start_time => '07:45',
minutes_interval => '60',
minutes_duration => '300',
},
}
scheduled_task { 'Notepad_daily_repeat_zeros':
ensure => present,
command => 'C:\Windows\notepad.exe',
trigger => {
schedule => daily,
start_time => '07:45',
minutes_interval => '0',
minutes_duration => '0',
},
}
# scheduled_task { 'Notepad_daily_repeat_should_error_duration_unspecified':
# ensure => present,
# command => 'C:\Windows\notepad.exe',
# trigger => {
# schedule => daily,
# start_time => '07:45',
# minutes_interval => '5',
# },
# }
# scheduled_task { 'Notepad_daily_repeat_should_error_duration_zero':
# ensure => present,
# command => 'C:\Windows\notepad.exe',
# trigger => {
# schedule => daily,
# start_time => '07:45',
# minutes_interval => '5',
# minutes_duration => '0',
# },a
# }
# scheduled_task { 'Notepad_daily_repeat_should_error_duration_lower':
# ensure => present,
# command => 'C:\Windows\notepad.exe',
# trigger => {
# schedule => daily,
# start_time => '07:45',
# minutes_interval => '5',
# minutes_duration => '4',
# },
# }
scheduled_task { 'Notepad_normal':
ensure => absent,
}
scheduled_task { 'Notepad_with_startdate':
ensure => absent,
}
scheduled_task { 'Weekly Task':
ensure => absent,
}
scheduled_task { 'Notepad_daily_repeat':
ensure => absent,
}
scheduled_task { 'Notepad_daily_repeat_zeros':
ensure => absent,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.