From 9285c155db894b9bc9f8fde24f8eac6b344b41e5 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Mon, 1 Jul 2024 15:26:34 +0200 Subject: [PATCH] Alllow running scan jobs --- manifests/script.pp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/manifests/script.pp b/manifests/script.pp index fdabf30..1f81093 100644 --- a/manifests/script.pp +++ b/manifests/script.pp @@ -56,6 +56,17 @@ class sunetdrive::script ( } $site_name = $config['site_name'] $user_bucket_name = $config['user_bucket_name'] + if $config['user_scans'].is_a?(Array) { + $config['user_scans'].each |$job| { + sunet::scriptherder::cronjob { $job['name']: + cmd => "ssh -t -l script ${job['server']} /usr/bin/sudo /usr/local/bin/occ ${job['container']} files:scan ${job['user']}", + hour => $job['hour'], + minute => $job['minute'], + ok_criteria => ['exit_status=0','max_age=1d'], + warn_criteria => ['exit_status=1','max_age=2d'], + } + } + } # It is a start that will get us user buckets and primary buckets $backup_projects = $location