Server IP : 51.89.169.208 / Your IP : 216.73.216.69 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /scripts/ |
Upload File : |
#!/usr/local/cpanel/3rdparty/bin/perl # Copyright 2024 WebPros International, LLC # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited. package scripts::perform_sqlite_auto_rebuild_db_maintenance; use strict; use warnings; use parent qw( Cpanel::HelpfulScript ); use constant _OPTIONS => (); use Try::Tiny; use Cpanel::Debug (); use Cpanel::LoadModule (); use Cpanel::Update::InProgress (); use Cpanel::Update::IsCron (); =encoding utf-8 =head1 NAME scripts::perform_sqlite_auto_rebuild_db_maintenance =head1 SYNOPSIS /scripts/perform_sqlite_auto_rebuild_db_maintenance =head1 DESCRIPTION This script is used by the maintenance script to automatically check and repair auto-rebuilt SQLite databases =cut __PACKAGE__->new(@ARGV)->run() if !caller(); use constant DATABASE_PACKAGES => qw( Cpanel::Apache::TLS::Index Cpanel::Apache::TLS::Index::DB Cpanel::BandwidthDB::RootCache Cpanel::BandwidthDB::RootCache Cpanel::EximStats::DB::Sqlite Cpanel::EximStats::DB::Sqlite ); sub run { my ($self) = @_; if ( Cpanel::Update::InProgress->is_on() && !Cpanel::Update::IsCron->is_on() ) { $self->say_maketext('A manual update of [asis,cPanel amp() WHM] is in progress. This script will exit now.'); return; } my %packages = DATABASE_PACKAGES(); for my $package ( keys %packages ) { try { Cpanel::LoadModule::load_perl_module($package); # Cpanel::Apache::TLS::Index uses Cpanel::Apache::TLS::Index::DB as its internal package for the database my $dbh = $packages{$package}->new( full_integrity_check => 1 ); } catch { Cpanel::Debug::log_warn("There was an error attempting to do an integrity check on '$package': $_"); }; } return; } 1;