cron added

This commit is contained in:
Charlie Root 2023-12-07 13:05:23 +01:00
parent 0bb0f006d1
commit 8c91b846a7
1 changed files with 30 additions and 0 deletions

30
lib.cf
View File

@ -408,3 +408,33 @@ files:
classes => results("namespace","etc_hosts"); classes => results("namespace","etc_hosts");
} }
bundle agent cron
{
vars:
"cron_d" string => "/etc/cron.d";
freebsd::
"cron_d" string => "/usr/local/etc/cron.d";
files:
"$(cron_d)/."
create => "true",
handle => "cron_d_created";
}
bundle agent create_cron_job(name,time,command)
{
methods:
"any" usebundle => cron;
files:
"$(cron.cron_d)/$(name)"
create => "true",
content => "#
# Managed by CFEngin
#
$(time) $(command)
",
depends_on => {"cron_d_created"};
}