From 84c0efdec7765e1d2916b5854c7317d62e05cf66 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 14 Sep 2018 16:31:56 +0200 Subject: [PATCH 1/2] Added option to disable dbclean --- database.sql | 3 ++- webcron.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/database.sql b/database.sql index 9363272..03e33ba 100644 --- a/database.sql +++ b/database.sql @@ -37,7 +37,8 @@ CREATE TABLE IF NOT EXISTS `config` ( INSERT INTO `config` (`conf`, `category`, `type`, `label`, `description`, `value`) VALUES ('dbclean.delay', 'Database Cleanup', 'number(0)', 'Cleanup Delay', 'How many days until the database cleanup is triggered', '7'), -('dbclean.expireruns', 'Database Cleanup', 'number(0)', 'Retention value', 'How many days does the database keep the runs', '30'), +('dbclean.expireruns', 'Database Cleanup', 'number(0)', 'Retention', 'How many days does the database keep the runs', '30'), +('dbclean.enabled', 'Database Cleanup', 'text', 'Enabled', 'Database cleanup enabled? (true: yes; false: no)', 'true'), ('dbclean.lastrun', 'Database Cleanup', 'hidden', 'Last run', 'Last run of database cleanup', UNIX_TIMESTAMP()), ('jobs.reboottime', 'Jobs', 'number(0,30)', 'Reboot delay', 'The amount of delay in minutes between scheduling a reboot and the actual reboot', '5'); diff --git a/webcron.php b/webcron.php index 9a12cf6..4e82949 100644 --- a/webcron.php +++ b/webcron.php @@ -105,7 +105,7 @@ foreach ($results as $result) { $nosave = false; } -if (get_configvalue('dbclean.lastrun') + (60 * 60 * 24 * get_configvalue('dbclean.delay')) < time()) clean_database(); +if ((get_configvalue('dbclean.enabled') == 'true') && (get_configvalue('dbclean.lastrun') + (60 * 60 * 24 * get_configvalue('dbclean.delay')) < time())) clean_database(); unlink('/tmp/webcron.lock'); From 3405300d3f9aafcefffe43c8548f61c7f9a3ed61 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 21 Sep 2018 13:03:12 +0200 Subject: [PATCH 2/2] Updated database --- database.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database.sql b/database.sql index 03e33ba..1eda469 100644 --- a/database.sql +++ b/database.sql @@ -38,7 +38,7 @@ CREATE TABLE IF NOT EXISTS `config` ( INSERT INTO `config` (`conf`, `category`, `type`, `label`, `description`, `value`) VALUES ('dbclean.delay', 'Database Cleanup', 'number(0)', 'Cleanup Delay', 'How many days until the database cleanup is triggered', '7'), ('dbclean.expireruns', 'Database Cleanup', 'number(0)', 'Retention', 'How many days does the database keep the runs', '30'), -('dbclean.enabled', 'Database Cleanup', 'text', 'Enabled', 'Database cleanup enabled? (true: yes; false: no)', 'true'), +('dbclean.enabled', 'Database Cleanup', 'text', 'Enabled', 'Database cleanup enabled? (true: yes; false: no)', 'false'), ('dbclean.lastrun', 'Database Cleanup', 'hidden', 'Last run', 'Last run of database cleanup', UNIX_TIMESTAMP()), ('jobs.reboottime', 'Jobs', 'number(0,30)', 'Reboot delay', 'The amount of delay in minutes between scheduling a reboot and the actual reboot', '5');