From a380eff24aaf34fa7d443de6e263db711074f94b Mon Sep 17 00:00:00 2001 From: eareyes Date: Mon, 2 May 2022 10:27:56 +0100 Subject: [PATCH 1/2] Added cron task recipe and geoipupdate cron job --- resources/metadata.rb | 1 + resources/recipes/configure_cron_tasks.rb | 11 +++++++++++ resources/recipes/default.rb | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 resources/recipes/configure_cron_tasks.rb diff --git a/resources/metadata.rb b/resources/metadata.rb index 0d83d50..46632e0 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -23,3 +23,4 @@ depends 'n2klocd' depends 'freeradius' depends 'k2http' +depends 'cron' \ No newline at end of file diff --git a/resources/recipes/configure_cron_tasks.rb b/resources/recipes/configure_cron_tasks.rb new file mode 100644 index 0000000..abc362d --- /dev/null +++ b/resources/recipes/configure_cron_tasks.rb @@ -0,0 +1,11 @@ +#--------------------------Geoipupdate-------------------------# +cron_d 'geoipupdate' do + comment "Update GeoIP and GeoLite Databases twice a week" + action :create + minute '41' + hour '17' + weekday '1,4' + retries 2 + ignore_failure true + command "/usr/local/bin/geoipupdate -v" +end \ No newline at end of file diff --git a/resources/recipes/default.rb b/resources/recipes/default.rb index c886a7b..4eb241d 100644 --- a/resources/recipes/default.rb +++ b/resources/recipes/default.rb @@ -9,4 +9,4 @@ include_recipe 'rb-proxy::prepare_system' include_recipe 'rb-proxy::configure' - +include_recipe 'rb-ips::configure_cron_tasks' From fbf43ffa1a09fb9231d39108bb6e31a0dcffd952 Mon Sep 17 00:00:00 2001 From: eareyes Date: Mon, 2 May 2022 10:50:57 +0100 Subject: [PATCH 2/2] Removed verbose mode to geoipupdate and changed its path --- resources/recipes/configure_cron_tasks.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/recipes/configure_cron_tasks.rb b/resources/recipes/configure_cron_tasks.rb index abc362d..12b7daa 100644 --- a/resources/recipes/configure_cron_tasks.rb +++ b/resources/recipes/configure_cron_tasks.rb @@ -7,5 +7,5 @@ weekday '1,4' retries 2 ignore_failure true - command "/usr/local/bin/geoipupdate -v" -end \ No newline at end of file + command "/usr/bin/geoipupdate" +end