systemd_cron
: systemd_cron Create systemd timer/service to replace cron jobs You either need to define on_calendar or on_boot_sec
systemd_cron Create systemd timer/service to replace cron jobs You either need to define on_calendar or on_boot_sec
systemd_cron { 'date':
on_calendar => '*:0/10',
command => '/bin/date',
service_description => 'Print date',
timer_description => 'Run date.service every 10 minutes',
}
The following parameters are available in the systemd_cron
defined type:
on_calendar
on_boot_sec
on_unitactive_sec
command
service_description
ensure
timer_description
type
user
additional_timer_params
additional_service_params
service_overrides
timer_overrides
service_unit_overrides
timer_unit_overrides
Data type: Optional[String]
systemd timer OnCalendar= definition when to run the service as defined in https://www.freedesktop.org/software/systemd/man/systemd.time.html
Default value: undef
Data type: Optional[Variant[Integer,String]]
systemd timer OnBootSec= definition
Default value: undef
Data type: Optional[Variant[Integer,String]]
systemd timer OnUnitActiveSec= definition
Default value: undef
Data type: Optional[String]
command string for ExecStart= defintion of the service to run as defined in https://www.freedesktop.org/software/systemd/man/systemd.service.html
Default value: undef
Data type: Optional[String]
string for Description= defintion of the service as defined in https://www.freedesktop.org/software/systemd/man/systemd.service.html
Default value: undef
Data type: Variant[Boolean,Enum['present','absent']]
removes the instance if set to false or absent
Default value: true
Data type: String
optional string for Description= defintion of the service as defined in https://www.freedesktop.org/software/systemd/man/systemd.timer.html
Default value: "timer for ${service_description}"
Data type: String
type of service as defined in https://www.freedesktop.org/software/systemd/man/systemd.service.html
Default value: 'oneshot'
Data type: String
username to run command User= as defined in https://www.freedesktop.org/software/systemd/man/systemd.service.html
Default value: 'root'
Data type: Optional[Array]
Deprecated use timer_overrides
instead
can not be used in combination with timer_overrides
array with lines to append to [Timer] section
example: 'additional_timer_params' => [ 'RandomizedDelaySec=10' ]
Default value: undef
Data type: Optional[Array]
Deprecated use service_overrides
instead
can not be used in combination with service_overrides
array with lines to append to [Service] section
example: 'additional_service_params' => [ 'User=bob' ]
Default value: undef
Data type: Systemd::Unit::Service
override for the[Service]
section of the service
can not be used in combination with additional_service_params
example: 'service_overrides' => { 'Wants' => 'network-online.target' }
Default value: {}
Data type: Systemd::Unit::Timer
override for the[Timer]
section of the timer
can not be used in combination with additional_timer_params
example: 'timer_overrides' => { 'OnBootSec' => '10' }
Default value: {}
Data type: Systemd::Unit::Unit
override for the[Unit]
section of the service
can not be used in combination with additional_service_params
example: 'service_unit_overrides' => { 'Wants' => 'network-online.target' }
Default value: {}
Data type: Systemd::Unit::Unit
override for the [Unit]
section of the timer
can not be used in combination with additional_timer_params
example: 'timer_unit_overrides' => { 'Documentation' => 'Very special timer' }
Default value: {}