From 2e896d47b3dd66b3ef0a019102d04b2f1635822c Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 19 Apr 2019 11:06:50 +0200 Subject: [PATCH] backup, disable cron when not enabled. closes https://github.com/opnsense/core/issues/3430 --- src/etc/inc/plugins.inc.d/core.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/etc/inc/plugins.inc.d/core.inc b/src/etc/inc/plugins.inc.d/core.inc index 4a09966f2..e717c8e6c 100644 --- a/src/etc/inc/plugins.inc.d/core.inc +++ b/src/etc/inc/plugins.inc.d/core.inc @@ -201,7 +201,12 @@ function core_cron() } } - $jobs[]['autocron'] = array('configctl system remote backup', 0, 1); + foreach ((new OPNsense\Backup\BackupFactory())->listProviders() as $classname => $provider) { + if ($provider['handle']->isEnabled()) { + $jobs[]['autocron'] = array('configctl system remote backup', 0, 1); + break; + } + } return $jobs; }