mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Make sytem status cron job use webmincron
This commit is contained in:
@@ -439,5 +439,33 @@ if (!$config{'collect_notemp'} &&
|
||||
return @rv;
|
||||
}
|
||||
|
||||
# scheduled_collect_system_info()
|
||||
# Called by Webmin Cron to collect system info
|
||||
sub scheduled_collect_system_info
|
||||
{
|
||||
my $start = time();
|
||||
|
||||
# Make sure we are not already running
|
||||
if (&test_lock($collected_info_file)) {
|
||||
print STDERR "scheduled_collect_system_info : Already running\n";
|
||||
return;
|
||||
}
|
||||
|
||||
# Don't diff collected file
|
||||
$gconfig{'logfiles'} = 0;
|
||||
$gconfig{'logfullfiles'} = 0;
|
||||
$WebminCore::gconfig{'logfiles'} = 0;
|
||||
$WebminCore::gconfig{'logfullfiles'} = 0;
|
||||
$no_log_file_changes = 1;
|
||||
&lock_file($collected_info_file);
|
||||
|
||||
$info = &collect_system_info();
|
||||
if ($info) {
|
||||
&save_collected_info($info);
|
||||
&add_historic_collected_info($info, $start);
|
||||
}
|
||||
&unlock_file($collected_info_file);
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
@@ -5,26 +5,5 @@
|
||||
package system_status;
|
||||
$main::no_acl_check++;
|
||||
require './system-status-lib.pl';
|
||||
$start = time();
|
||||
|
||||
# Make sure we are not already running
|
||||
if (&test_lock($collected_info_file)) {
|
||||
print "Already running\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
# Don't diff collected file
|
||||
$gconfig{'logfiles'} = 0;
|
||||
$gconfig{'logfullfiles'} = 0;
|
||||
$WebminCore::gconfig{'logfiles'} = 0;
|
||||
$WebminCore::gconfig{'logfullfiles'} = 0;
|
||||
$no_log_file_changes = 1;
|
||||
&lock_file($collected_info_file);
|
||||
|
||||
$info = &collect_system_info();
|
||||
if ($info) {
|
||||
&save_collected_info($info);
|
||||
&add_historic_collected_info($info, $start);
|
||||
}
|
||||
&unlock_file($collected_info_file);
|
||||
&scheduled_collect_system_info();
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ Functions for creating and listing Webmin scheduled functions.
|
||||
|
||||
=cut
|
||||
|
||||
# XXX actually call in miniserv.pl
|
||||
# XXX keep track of last call time
|
||||
# XXX UI
|
||||
# XXX support cron-style time specs
|
||||
# XXX make sure temp files are cleaned up
|
||||
# XXX switch all cron jobs at install time
|
||||
|
||||
BEGIN { push(@INC, ".."); };
|
||||
use WebminCore;
|
||||
|
||||
Reference in New Issue
Block a user