I need to schedule a cron job for daily running every 30 mins from 0 to 6 and from 13 to 23. I tried this code:
cron { "MyJob":
ensure => present,
command => "my-cron-command",
user => 'root',
hour => "0-6,13-23",
minute => '*/30',
environment => "MY_ENV"
}
This fails with
0-6,13-23 is not a valid hour
What hour
format should I use? Do I need any other changes in cron clause?
Close, but no cigar.
cron { "MyJob":
ensure => present,
command => "my-cron-command",
user => 'root',
hour => [ "0-6", "13-23" ],
minute => '*/30',
environment => "MY_ENV"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With