Regenerate disk_list file if too old
This commit is contained in:
parent
a9d76dd030
commit
e55b2d990f
|
@ -22,6 +22,15 @@ my $CACHEFILE = "$ENV{'XYMONTMP'}/$ENV{'MACHINEDOTS'}.smart.cache";
|
||||||
|
|
||||||
&load_config("$ENV{'XYMONTMP'}/logfetch.$ENV{'MACHINEDOTS'}.cfg");
|
&load_config("$ENV{'XYMONTMP'}/logfetch.$ENV{'MACHINEDOTS'}.cfg");
|
||||||
|
|
||||||
|
my @disks_stat = stat($temp_disk_list);
|
||||||
|
my $disks_mtime = scalar @disks_stat ? $disks_stat[9] : 0;
|
||||||
|
#
|
||||||
|
# Regenerate disks list if the file is too old (600 minutes)
|
||||||
|
if (time() - $disks_mtime > 600)
|
||||||
|
{
|
||||||
|
unlink $temp_disk_list;
|
||||||
|
}
|
||||||
|
|
||||||
if (-e $temp_disk_list) {
|
if (-e $temp_disk_list) {
|
||||||
# Should use the existing file
|
# Should use the existing file
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue