Linux ams-business-8.hostwindsdns.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64
LiteSpeed
Server IP : 192.236.177.161 & Your IP : 216.73.216.154
Domains :
Cant Read [ /etc/named.conf ]
User : ajzdfbpz
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
local /
cpanel /
scripts /
Delete
Unzip
Name
Size
Permission
Date
Action
cpan_sandbox
[ DIR ]
drwxr-xr-x
2017-06-12 18:25
php_sandbox
[ DIR ]
drwxr-xr-x
2020-12-20 04:48
MirrorSearch_pingtest
2.38
KB
-rwxr-xr-x
2022-05-16 17:46
activesync-invite-reply
1.69
KB
-rwxr-xr-x
2022-05-16 17:46
add_dns
2.36
KB
-rwxr-xr-x
2022-05-16 17:46
adddns
2.36
KB
-rwxr-xr-x
2022-05-16 17:46
addpop
6.08
KB
-rwxr-xr-x
2022-05-16 17:47
addsystemuser
3.27
KB
-rwxr-xr-x
2022-05-16 17:46
adduser
92
B
-rwxr-xr-x
2017-06-12 18:25
agent360.sh
16.03
KB
-rwx------
2025-09-17 21:17
apachelimits
4.31
KB
-rwxr-xr-x
2022-05-16 17:46
archive_sync_zones
3.05
KB
-rwxr-xr-x
2025-04-01 22:56
auto-adjust-mysql-limits
1.81
KB
-rwxr-xr-x
2022-05-16 17:46
autorepair
1.24
KB
-rwxr-xr-x
2022-05-16 17:46
backups_clean_metadata_for_missing_backups
1.57
KB
-rwxr-xr-x
2022-05-16 17:46
backups_create_metadata
15.75
KB
-rwxr-xr-x
2022-05-16 17:46
backups_list_user_files
4.56
KB
-rwxr-xr-x
2022-05-16 17:46
balance_linked_node_quotas
2.58
KB
-rwxr-xr-x
2022-05-16 17:47
before_apache_make
232
B
-rwxr-xr-x
2026-02-17 12:31
biglogcheck
1.69
KB
-rwxr-xr-x
2022-05-16 17:46
build_bandwidthdb_root_cache_in_background
1.52
KB
-rwxr-xr-x
2022-05-16 17:46
build_cpnat
3.41
KB
-rwxr-xr-x
2022-05-16 17:46
build_mail_sni
3.87
KB
-rwxr-xr-x
2022-09-24 10:10
build_maxemails_config
1.14
KB
-rwxr-xr-x
2022-05-16 17:46
builddovecotconf
6.76
KB
-rwxr-xr-x
2022-05-16 17:46
buildeximconf
7
KB
-rwxr-xr-x
2023-03-11 10:28
buildhttpdconf
2.6
KB
-rwxr-xr-x
2022-05-16 17:46
buildpureftproot
539
B
-rwxr-xr-x
2022-05-16 17:47
ccs-check
4.91
KB
-rwxr-xr-x
2022-05-16 17:47
check_cpanel_pkgs
10.75
KB
-rwxr-xr-x
2022-05-16 17:46
check_cpanel_rpms
218
B
-rwxr-xr-x
2021-12-14 12:30
check_domain_tls_service_domains.pl
6.68
KB
-rwxr-xr-x
2022-05-16 17:46
check_immutable_files
5.49
KB
-rwxr-xr-x
2022-05-16 17:47
check_mail_spamassassin_compiledregexps_body_0
187
B
-rwxr-xr-x
2017-06-12 18:25
check_maxmem_against_domains_count
3.57
KB
-rwxr-xr-x
2022-05-16 17:46
check_mount_procfs
2.02
KB
-rwxr-xr-x
2022-05-16 17:46
check_mysql
5.55
KB
-rwxr-xr-x
2022-09-24 10:10
check_plugin_pkgs
2.45
KB
-rwxr-xr-x
2025-04-01 22:56
check_security_advice_changes
8.28
KB
-rwxr-xr-x
2023-03-11 10:28
check_unmonitored_enabled_services
4.56
KB
-rwxr-xr-x
2022-09-24 10:10
check_unreliable_resolvers
3.59
KB
-rwxr-xr-x
2022-05-16 17:46
check_users_my_cnf
6.05
KB
-rwxr-xr-x
2022-05-16 17:46
check_valid_server_hostname
7.66
KB
-rwxr-xr-x
2022-09-24 10:10
checkalldomainsmxs
2.4
KB
-rwxr-xr-x
2022-05-16 17:46
checkbashshell
1.18
KB
-rwxr-xr-x
2022-05-16 17:46
checkccompiler
1.22
KB
-rwxr-xr-x
2022-05-16 17:46
checkexim.pl
3.1
KB
-rwxr-xr-x
2022-05-16 17:46
checklink
1.29
KB
-rwxr-xr-x
2022-05-16 17:46
checkusers
856
B
-rwxr-xr-x
2022-05-16 17:47
chkpaths
141
B
-rwxr-xr-x
2017-06-12 18:25
chpass
416
B
-rwxr-xr-x
2022-05-16 17:46
ckillall
1.11
KB
-rwxr-xr-x
2022-05-16 17:47
cl_pkg_verify_hook.py
2.38
KB
-rwxr-xr-x
2026-01-30 12:30
clean_dead_mailman_locks
2.09
KB
-rwxr-xr-x
2022-05-16 17:46
clean_up_temp_wheel_users
2.44
KB
-rwxr-xr-x
2022-05-16 17:46
clean_user_php_sessions
4.76
KB
-rwxr-xr-x
2022-08-26 11:30
cleandns
13.11
KB
-rwxr-xr-x
2025-04-01 22:56
cleandns8
417
B
-rwxr-xr-x
2022-05-16 17:46
cleanmsglog
735
B
-rwxr-xr-x
2017-06-12 18:25
cleanphpsessions
932
B
-rwxr-xr-x
2022-05-16 17:46
cleanphpsessions.php
658
B
-rw-r--r--
2022-08-16 11:30
cleanquotas
1.61
KB
-rwxr-xr-x
2022-05-16 17:46
cleansessions
5.89
KB
-rwxr-xr-x
2025-04-01 22:56
cleanupinterchange
2.64
KB
-rwxr-xr-x
2022-05-16 17:46
cleanupmysqlprivs
533
B
-rwxr-xr-x
2021-12-14 12:30
clear_cpaddon_ui_caches
1.27
KB
-rwxr-xr-x
2022-05-16 17:46
clear_orphaned_virtfs_mounts
3.56
KB
-rwxr-xr-x
2022-05-16 17:46
comparecdb
1.52
KB
-rwxr-xr-x
2022-05-16 17:46
compilers
2.86
KB
-rwxr-xr-x
2022-05-16 17:46
compilerscheck
999
B
-rwxr-xr-x
2022-05-16 17:47
configure_firewall_for_cpanel
520
B
-rwxr-xr-x
2022-05-16 17:46
configure_rh_firewall_for_cpanel
520
B
-rwxr-xr-x
2022-05-16 17:46
configure_rh_ipv6_firewall_for_cpanel
520
B
-rwxr-xr-x
2022-05-16 17:46
convert2dovecot
682
B
-rwxr-xr-x
2022-05-16 17:46
convert_accesshash_to_token
4.07
KB
-rwxr-xr-x
2022-05-16 17:46
convert_and_migrate_from_legacy_backup
1.97
KB
-rwxr-xr-x
2022-05-16 17:46
convert_maildir_to_mdbox
1.66
KB
-rwxr-xr-x
2022-05-16 17:46
convert_mdbox_to_maildir
1.66
KB
-rwxr-xr-x
2022-05-16 17:47
convert_roundcube_mysql2sqlite
26.27
KB
-rwxr-xr-x
2025-04-01 22:56
convert_to_dovecot_delivery
4.33
KB
-rwxr-xr-x
2022-05-16 17:46
convert_whmxfer_to_sqlite
1.46
KB
-rwxr-xr-x
2022-05-16 17:46
copy_user_mail_as_root
1.25
KB
-rwxr-xr-x
2022-05-16 17:46
copy_user_mail_as_user
1.34
KB
-rwxr-xr-x
2022-05-16 17:46
cpaddonsup
3.25
KB
-rwxr-xr-x
2022-05-16 17:47
cpan_config
2.8
KB
-rwxr-xr-x
2022-05-16 17:46
cpanel_initial_install
67.18
KB
-rwxr-xr-x
2025-04-01 22:56
cpanelsync
28.31
KB
-rwxr-xr-x
2022-05-16 17:46
cpanelsync_postprocessor
1.62
KB
-rwxr-xr-x
2022-05-16 17:46
cpanpingtest
965
B
-rwxr-xr-x
2022-05-16 17:46
cpbackup
44.79
KB
-rwxr-xr-x
2025-04-01 22:56
cpbackup_transport_file
5.65
KB
-rwxr-xr-x
2023-03-11 10:28
cpdig
1.81
KB
-rwxr-xr-x
2022-05-16 17:46
cpfetch
1.23
KB
-rwxr-xr-x
2022-05-16 17:47
cphulkdblacklist
433
B
-rwxr-xr-x
2022-05-16 17:46
cphulkdwhitelist
1.3
KB
-rwxr-xr-x
2022-05-16 17:46
cpservice
2.87
KB
-rwxr-xr-x
2022-05-16 17:46
cpuser_port_authority
19.29
KB
-rwxr-xr-x
2022-05-16 17:46
cpuser_service_manager
10.85
KB
-rwxr-xr-x
2022-09-24 10:10
create_default_featurelist
11.62
KB
-rwx------
2026-02-16 22:13
createacct
26.95
MB
-rwx------
2025-10-17 11:30
custom_backup_destination.pl.sample
5.06
KB
-rwxr-xr-x
2022-09-24 10:10
custom_backup_destination.pl.skeleton
2.84
KB
-rwxr-xr-x
2022-05-16 17:46
dcpumon-wrapper
850
B
-rwxr-xr-x
2022-05-16 17:46
delpop
6.2
KB
-rwxr-xr-x
2022-05-16 17:46
detect_env_capabilities
508
B
-rwxr-xr-x
2022-05-16 17:46
disable_prelink
2.77
KB
-rwxr-xr-x
2022-05-16 17:47
disable_sqloptimizer
1.49
KB
-rwxr-xr-x
2022-05-16 17:46
disablefileprotect
2.19
KB
-rwxr-xr-x
2025-04-01 22:56
distro_changed_hook
1.16
KB
-rwxr-xr-x
2022-05-16 17:46
dnscluster
4.44
KB
-rwxr-xr-x
2022-05-16 17:47
dnsqueuecron
1.29
KB
-rwxr-xr-x
2022-05-16 17:46
dnssec-cluster-keys
3.75
KB
-rwxr-xr-x
2022-05-16 17:46
dovecot_maintenance
7.93
KB
-rwxr-xr-x
2022-05-16 17:46
dovecot_set_defaults.pl
984
B
-rwxr-xr-x
2022-05-16 17:46
dumpcdb
866
B
-rwxr-xr-x
2022-05-16 17:46
dumpinodes
687
B
-rwxr-xr-x
2022-05-16 17:46
dumpquotas
616
B
-rwxr-xr-x
2022-05-16 17:46
dumpstor
913
B
-rwxr-xr-x
2022-05-16 17:47
ea4_fresh_install
2.64
KB
-rwxr-xr-x
2022-05-16 17:46
edit_cpanelsync_exclude_list
2.58
KB
-rwxr-xr-x
2022-05-16 17:46
editquota
3.43
KB
-rwxr-xr-x
2025-04-01 22:56
elevate-cpanel
187.75
KB
-rwx------
2024-02-12 23:25
email_archive_maintenance
6.15
KB
-rwxr-xr-x
2022-05-16 17:46
email_hold_maintenance
1.46
KB
-rwxr-xr-x
2022-05-16 17:47
enable_spf_dkim_globally
8.83
KB
-rwxr-xr-x
2022-05-16 17:46
enable_sqloptimizer
1.57
KB
-rwxr-xr-x
2022-05-16 17:46
enablefileprotect
2.1
KB
-rwxr-xr-x
2022-05-16 17:46
ensure_autoenabled_features
2.93
MB
-rwx------
2025-10-17 11:30
ensure_conf_dir_crt_key
4.82
KB
-rwxr-xr-x
2022-05-16 17:46
ensure_cpuser_file_ip
2.55
KB
-rwxr-xr-x
2022-05-16 17:46
ensure_crontab_permissions
1.08
KB
-rwxr-xr-x
2022-05-16 17:46
ensure_dovecot_memory_limits_meet_minimum
3.13
KB
-rwxr-xr-x
2022-05-16 17:46
ensure_hostname_resolves
2.51
KB
-rwxr-xr-x
2025-04-01 22:56
ensure_includes
601
B
-rwxr-xr-x
2022-05-16 17:46
ensure_vhost_includes
13.53
KB
-rwxr-xr-x
2022-05-16 17:46
exim_tidydb
2.96
KB
-rwxr-xr-x
2022-05-16 17:46
eximconfgen
1.32
KB
-rwxr-xr-x
2022-05-16 17:46
eximstats_spam_check
867
B
-rwxr-xr-x
2022-05-16 17:46
export_horde_calendars_to_ics
15.07
KB
-rwxr-xr-x
2023-08-01 11:30
export_horde_contacts_to_vcf
13.94
KB
-rwxr-xr-x
2023-05-06 10:14
expunge_expired_certificates_from_sslstorage
3.56
KB
-rwxr-xr-x
2022-05-16 17:46
expunge_expired_pkgacct_sessions
852
B
-rwxr-xr-x
2022-05-16 17:46
expunge_expired_transfer_sessions
1.06
KB
-rwxr-xr-x
2022-05-16 17:46
fastmail
5.16
KB
-rwxr-xr-x
2022-05-16 17:46
featuremod
1.92
KB
-rwxr-xr-x
2022-05-16 17:46
fetchfile
422
B
-rwxr-xr-x
2022-05-16 17:46
find_and_fix_rpm_issues
6.99
KB
-rwxr-xr-x
2022-05-16 17:46
find_outdated_services
6.06
KB
-rwxr-xr-x
2025-04-01 22:56
find_pids_with_inotify_watch_on_path
3.66
KB
-rwxr-xr-x
2022-05-16 17:46
fix-cpanel-perl
28.94
KB
-rwxr-xr-x
2025-10-17 11:30
fix-listen-on-localhost
3.52
KB
-rwxr-xr-x
2022-05-16 17:46
fix-web-vhost-configuration
6.15
KB
-rwxr-xr-x
2022-05-16 17:46
fix_addon_permissions
7.68
KB
-rwxr-xr-x
2022-05-16 17:46
fix_dns_zone_ttls
1.34
KB
-rwxr-xr-x
2022-05-16 17:46
fix_innodb_tables
4.05
KB
-rwxr-xr-x
2022-05-16 17:46
fix_reseller_acls
10.88
KB
-rwxr-xr-x
2022-05-16 17:47
fixetchosts
4.32
KB
-rwxr-xr-x
2022-05-16 17:47
fixheaders
572
B
-rwxr-xr-x
2022-05-16 17:46
fixmailinglistperms
1008
B
-rwxr-xr-x
2022-05-16 17:46
fixmailman
2.09
KB
-rwxr-xr-x
2022-05-16 17:46
fixnamedviews
1.22
KB
-rwxr-xr-x
2022-05-16 17:46
fixndc
413
B
-rwxr-xr-x
2022-05-16 17:47
fixquotas
18.47
KB
-rwxr-xr-x
2025-04-01 22:56
fixrelayd
1.74
KB
-rwxr-xr-x
2022-05-16 17:46
fixrndc
16.39
KB
-rwxr-xr-x
2025-04-01 22:56
fixtar
503
B
-rwxr-xr-x
2022-05-16 17:46
fixtlsversions
4.7
KB
-rwxr-xr-x
2022-05-16 17:46
fixvaliases
2
KB
-rwxr-xr-x
2022-05-16 17:46
fixwebalizer
966
B
-rwxr-xr-x
2022-05-16 17:47
forcelocaldomain
895
B
-rwxr-xr-x
2022-05-16 17:46
ftpfetch
2.2
KB
-rwxr-xr-x
2020-12-20 04:47
ftpquotacheck
8.31
KB
-rwxr-xr-x
2022-05-16 17:47
ftpsfetch
2.36
KB
-rwxr-xr-x
2020-12-20 04:47
ftpupdate
261
B
-rwxr-xr-x
2020-12-20 04:54
gather_update_log_stats
4.25
KB
-rwx------
2026-02-16 21:57
gather_update_logs_setupcrontab
5.45
KB
-rwx------
2026-02-16 21:57
gemwrapper
1.74
KB
-rwxr-xr-x
2022-05-16 17:46
gencrt
6.26
KB
-rwxr-xr-x
2022-05-16 17:46
generate_account_suspension_include
5.7
KB
-rwxr-xr-x
2022-05-16 17:47
generate_google_drive_credentials
1.11
KB
-rwxr-xr-x
2022-05-16 17:47
generate_google_drive_oauth_uri
984
B
-rwxr-xr-x
2022-05-16 17:46
generate_maildirsize
13.94
KB
-rwxr-xr-x
2023-03-11 10:28
gensysinfo
1.16
KB
-rwxr-xr-x
2022-05-16 17:46
get_locale_from_legacy_name_info
1.99
KB
-rwxr-xr-x
2022-05-16 17:46
getremotecpmove
12.67
KB
-rwxr-xr-x
2022-09-24 10:10
grpck
1.19
KB
-rwxr-xr-x
2022-05-16 17:46
hackcheck
3.02
KB
-rwxr-xr-x
2022-05-16 17:46
hook
1.45
KB
-rwxr-xr-x
2022-05-16 17:46
httpspamdetect
2.66
KB
-rwxr-xr-x
2022-05-16 17:46
hulk-unban-ip
3.96
MB
-rwx------
2025-10-17 11:30
import_exim_data
8.39
KB
-rwxr-xr-x
2022-09-24 10:10
increase_filesystem_limits
891
B
-rwxr-xr-x
2022-05-16 17:46
initacls
4.99
KB
-rwxr-xr-x
2022-05-16 17:46
initfpsuexec
444
B
-rwxr-xr-x
2022-05-16 17:47
initialize_360monitoring
2.76
KB
-rwx------
2025-11-13 13:58
initquotas
19.47
KB
-rwxr-xr-x
2022-05-16 17:46
initsuexec
4.03
KB
-rwxr-xr-x
2022-05-16 17:46
install_cpanel_analytics
1.93
KB
-rwxr-xr-x
2023-05-06 10:14
install_dovecot_fts
1.57
KB
-rwxr-xr-x
2022-05-16 17:46
install_plugin
2.8
KB
-rwxr-xr-x
2022-09-24 10:10
installpkg
575
B
-rwxr-xr-x
2022-05-16 17:46
installpostgres
6.56
KB
-rwxr-xr-x
2022-05-16 17:46
installsqlite3
1.82
KB
-rwxr-xr-x
2022-05-16 17:46
ipcheck
3.93
KB
-rwxr-xr-x
2022-05-16 17:46
ipusage
7.45
KB
-rwxr-xr-x
2022-05-16 17:47
isdedicatedip
602
B
-rwxr-xr-x
2022-05-16 17:46
jetbackup-check
3.69
KB
-rwxr-xr-x
2022-05-16 17:47
killdns
422
B
-rwxr-xr-x
2022-05-16 17:46
killdns-dnsadmin
1.15
KB
-rwxr-xr-x
2022-05-16 17:47
killmysqluserprivs
433
B
-rwxr-xr-x
2022-05-16 17:46
killmysqlwildcard
1.15
KB
-rwxr-xr-x
2022-05-16 17:46
killpvhost
853
B
-rwxr-xr-x
2022-05-16 17:46
killspamkeys
937
B
-rwxr-xr-x
2022-05-16 17:46
link_3rdparty_binaries
1.24
KB
-rwxr-xr-x
2022-07-19 11:30
linksubemailtomainacct
3.17
KB
-rwxr-xr-x
2022-05-16 17:46
listcheck
538
B
-rwxr-xr-x
2022-05-16 17:46
listsubdomains
1.05
KB
-rwxr-xr-x
2022-05-16 17:47
litespeed-check
3.86
KB
-rwxr-xr-x
2022-05-16 17:46
locale_export
4.82
KB
-rwxr-xr-x
2022-05-16 17:46
locale_import
4.35
KB
-rwxr-xr-x
2022-05-16 17:46
locale_info
3.99
KB
-rwxr-xr-x
2022-05-16 17:46
logo.dat
205
B
-rw-r--r--
2017-06-12 18:25
magicloader
1.94
KB
-rwxr-xr-x
2022-05-16 17:46
maildir_converter
6.08
KB
-rwxr-xr-x
2022-05-16 17:47
mailperm
16.53
KB
-rwxr-xr-x
2025-04-01 22:56
mailscannerupdate
2.42
KB
-rwxr-xr-x
2022-05-16 17:46
mainipcheck
10
KB
-rwxr-xr-x
2022-05-16 17:46
maintenance
46.87
KB
-rwxr-xr-x
2025-04-01 22:56
make_config
407
B
-rw-r--r--
2017-06-12 18:25
make_hostname_unowned
1.16
KB
-rwxr-xr-x
2022-05-16 17:46
manage_extra_marketing
12.76
KB
-rwx------
2026-02-16 22:13
manage_greylisting
16.19
KB
-rwxr-xr-x
2022-09-24 10:10
manage_mysql_profiles
16.33
KB
-rwxr-xr-x
2025-04-01 22:56
migrate-pdns-conf
9.83
KB
-rwxr-xr-x
2024-09-19 11:30
migrate_legacy_wordpress_to_modern_wordpress
12.99
KB
-rwx------
2025-05-19 04:08
migrate_local_ini_to_php_ini
7.41
KB
-rwxr-xr-x
2022-05-16 17:46
migrate_whmtheme_file_to_userdata
2.95
KB
-rwxr-xr-x
2022-05-16 17:46
mkwwwacctconf
2.33
KB
-rwxr-xr-x
2023-03-11 10:28
modify_accounts
4.09
KB
-rwxr-xr-x
2022-09-24 10:10
modify_featurelist
10.31
KB
-rwx------
2026-02-16 22:13
modify_packages
3.65
KB
-rwxr-xr-x
2022-09-24 10:10
modsec_vendor
15.63
KB
-rwxr-xr-x
2022-05-16 17:46
mysqlconnectioncheck
6.55
KB
-rwxr-xr-x
2022-05-16 17:46
mysqlpasswd
4.09
KB
-rwxr-xr-x
2022-05-16 17:46
named.ca
1.57
KB
-rw-r--r--
2017-06-12 18:25
named.rfc1912.zones
774
B
-rw-r--r--
2020-12-20 04:08
notify_expiring_certificates
9.37
KB
-rwxr-xr-x
2022-07-19 11:30
notify_expiring_certificates_on_linked_nodes
1.33
KB
-rwxr-xr-x
2022-09-24 10:10
oopscheck
1.12
KB
-rwxr-xr-x
2022-05-16 17:46
optimize_eximstats
3.88
KB
-rwxr-xr-x
2022-05-16 17:46
patch_mail_spamassassin_compiledregexps_body_0
2.39
KB
-rwxr-xr-x
2022-05-16 17:46
patchfdsetsize
2.72
KB
-rwxr-xr-x
2022-05-16 17:46
pedquota
2.26
KB
-rwxr-xr-x
2022-05-16 17:47
perform_sqlite_auto_rebuild_db_maintenance
2.2
KB
-rwxr-xr-x
2022-05-16 17:46
perlinstaller
528
B
-rwxr-xr-x
2022-05-16 17:46
perlmods
1.18
KB
-rwxr-xr-x
2022-05-16 17:46
php_fpm_config
9.73
KB
-rwxr-xr-x
2022-05-16 17:46
phpini_tidy
687
B
-rwxr-xr-x
2022-05-16 17:46
pkgacct
87.82
KB
-rwxr-xr-x
2023-05-06 10:14
post_snapshot
3.16
KB
-rwxr-xr-x
2023-03-11 10:28
post_sync_cleanup
6.09
KB
-rwxr-xr-x
2022-05-16 17:46
posteasyapache
123
B
-rwxr-xr-x
2026-01-26 14:49
postkillacct
85
B
-rwxr-xr-x
2026-01-30 12:30
postmodifyacct
12
B
-rwxr-xr-x
2026-01-30 12:30
postrestoreacct
12
B
-rwxr-xr-x
2026-01-26 14:49
postupcp
373
B
-rwxr-xr-x
2026-02-17 12:31
postupcp.cloudlinux-linksafe.bak
52
B
-rwxr-xr-x
2017-07-10 20:09
postwwwacct
148
B
-rwxr-xr-x
2026-01-30 12:30
prekillacct
12
B
-rwxr-xr-x
2026-01-30 12:30
preupcp
12
B
-rwxr-xr-x
2026-01-30 12:30
primary_virtual_host_migration
2.44
KB
-rwxr-xr-x
2022-05-16 17:46
process_pending_cpanel_php_pear_registration
2.72
KB
-rwxr-xr-x
2025-04-01 22:56
process_site_templates
7.27
KB
-rwxr-xr-x
2022-05-16 17:46
proxydomains
9.34
KB
-rwxr-xr-x
2022-05-16 17:46
ptycheck
724
B
-rwxr-xr-x
2022-05-16 17:46
purge_modsec_log
1.53
KB
-rwxr-xr-x
2022-05-16 17:46
purge_old_config_caches
2.08
KB
-rwxr-xr-x
2022-05-16 17:46
pwck
708
B
-rwxr-xr-x
2022-05-16 17:46
quickdnslookup
1.13
KB
-rwxr-xr-x
2022-05-16 17:46
quickwhoisips
2.29
KB
-rwxr-xr-x
2022-09-24 10:10
quota_auto_fix
1.41
KB
-rwxr-xr-x
2022-05-16 17:46
quotacheck
22.36
KB
-rwxr-xr-x
2022-09-24 10:10
rawchpass
460
B
-rwxr-xr-x
2022-05-16 17:46
rdate
4.8
KB
-rwxr-xr-x
2022-09-24 10:10
realadduser
5.61
KB
-rwxr-xr-x
2022-05-16 17:47
realchpass
3.26
KB
-rwxr-xr-x
2022-05-16 17:46
realperlinstaller
5.67
KB
-rwxr-xr-x
2022-05-16 17:46
realrawchpass
425
B
-rwxr-xr-x
2022-05-16 17:46
rebuild_available_addons_packages_cache
1.27
KB
-rwxr-xr-x
2022-05-16 17:46
rebuild_available_rpm_addons_cache
1.27
KB
-rwxr-xr-x
2022-05-16 17:46
rebuild_bandwidthdb_root_cache
1.45
KB
-rwxr-xr-x
2022-05-16 17:46
rebuild_dbmap
5.8
KB
-rwxr-xr-x
2022-05-16 17:46
rebuild_provider_openid_connect_links_db
1.01
KB
-rwxr-xr-x
2022-05-16 17:47
rebuild_whm_chrome
2.22
KB
-rwxr-xr-x
2022-05-16 17:46
rebuilddnsconfig
26.42
KB
-rwxr-xr-x
2025-04-01 22:56
rebuildhttpdconf
2.6
KB
-rwxr-xr-x
2022-05-16 17:46
rebuildinstalledssldb
2.85
KB
-rwxr-xr-x
2022-05-16 17:47
rebuildippool
509
B
-rwxr-xr-x
2022-05-16 17:46
rebuilduserssldb
948
B
-rwxr-xr-x
2022-05-16 17:47
refresh-dkim-validity-cache
5.97
KB
-rwxr-xr-x
2022-05-16 17:46
regenerate_tokens
2.18
KB
-rwxr-xr-x
2022-09-24 10:10
remote_log_transfer
11.6
KB
-rwxr-xr-x
2023-03-11 10:28
remove_dovecot_index_files
5.89
KB
-rwxr-xr-x
2022-05-16 17:46
removeacct
23.11
MB
-rwx------
2025-10-17 11:30
rescan_user_dovecot_fts
2.98
KB
-rwxr-xr-x
2022-05-16 17:46
reset_mail_quotas_to_sane_values
6.82
KB
-rwxr-xr-x
2022-05-16 17:46
resetmailmanurls
2.03
KB
-rwxr-xr-x
2022-05-16 17:46
resetquotas
4.61
KB
-rwxr-xr-x
2025-04-01 22:56
restartsrv
3.19
KB
-rwxr-xr-x
2025-04-01 22:56
restartsrv_apache
422
B
-rwxr-xr-x
2022-05-16 17:46
restartsrv_apache_php_fpm
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_base
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_bind
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_chkservd
427
B
-rwxr-xr-x
2022-05-16 17:46
restartsrv_clamd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_cpanel_dovecot_solr
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_cpanel_php_fpm
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_cpanellogd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_cpdavd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_cpgreylistd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_cphulkd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_cpipv6
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_cpsrvd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_crond
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_dnsadmin
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_dovecot
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_exim
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_eximstats
504
B
-rwxr-xr-x
2022-05-16 17:46
restartsrv_ftpd
426
B
-rwxr-xr-x
2022-05-16 17:46
restartsrv_ftpserver
911
B
-rwxr-xr-x
2022-05-16 17:47
restartsrv_httpd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_imap
437
B
-rwxr-xr-x
2022-05-16 17:46
restartsrv_inetd
2.47
KB
-rwxr-xr-x
2022-09-24 10:10
restartsrv_ipaliases
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_lmtp
437
B
-rwxr-xr-x
2022-05-16 17:46
restartsrv_mailman
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_mysql
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_named
579
B
-rwxr-xr-x
2025-04-01 22:56
restartsrv_nscd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_p0f
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_pdns
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_pop3
437
B
-rwxr-xr-x
2022-05-16 17:46
restartsrv_postgres
427
B
-rwxr-xr-x
2022-05-16 17:47
restartsrv_postgresql
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_powerdns
442
B
-rwxr-xr-x
2022-05-16 17:46
restartsrv_proftpd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_pureftpd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_queueprocd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_rsyslog
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_rsyslogd
437
B
-rwxr-xr-x
2022-05-16 17:46
restartsrv_spamd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_sshd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_syslogd
2.4
KB
-rwxr-xr-x
2022-07-19 11:30
restartsrv_tailwatchd
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_unknown
10.15
MB
-rwxr-xr-x
2025-10-17 11:30
restartsrv_xinetd
422
B
-rwxr-xr-x
2022-05-16 17:46
restorecpuserfromcache
1.96
KB
-rwxr-xr-x
2022-05-16 17:46
restorepkg
37.58
MB
-rwx------
2025-11-06 12:30
rfc1912_zones.tar
10
KB
-rw-r--r--
2017-06-12 18:25
rpmup
5.07
KB
-rwxr-xr-x
2025-04-01 22:56
rsync-user-homedir.pl
5.76
KB
-rwxr-xr-x
2022-05-16 17:46
run_if_exists
512
B
-rwxr-xr-x
2022-05-16 17:46
run_plugin_lifecycle
3.72
KB
-rwx------
2026-02-16 22:13
runstatsonce
440
B
-rwxr-xr-x
2022-05-16 17:46
runweblogs
1.02
KB
-rwxr-xr-x
2022-05-16 17:47
sa-update_wrapper
3.34
KB
-rwxr-xr-x
2022-05-16 17:46
safetybits.pl
844
B
-rwxr-xr-x
2022-05-16 17:47
secureit
4.72
KB
-rwxr-xr-x
2022-05-16 17:46
securemysql
4.4
KB
-rwxr-xr-x
2025-04-01 22:56
securerailsapps
3.58
KB
-rwxr-xr-x
2022-05-16 17:46
securetmp
15.99
KB
-rwxr-xr-x
2023-08-01 11:30
selectorunparkhook.py
1.7
KB
-rwxr-xr-x
2026-01-30 12:30
sendicq
474
B
-rwxr-xr-x
2022-05-16 17:47
servicedomains
9.34
KB
-rwxr-xr-x
2022-05-16 17:46
set_mailman_archive_perms
1.75
KB
-rwxr-xr-x
2022-05-16 17:46
setpostgresconfig
6.04
KB
-rwxr-xr-x
2022-05-16 17:46
setup_greylist_db
16.19
KB
-rwxr-xr-x
2022-09-24 10:10
setup_modsec_db
1.3
KB
-rwxr-xr-x
2022-05-16 17:47
setup_systemd_timer_for_plugins
3.92
KB
-rwx------
2026-02-16 22:13
setupftpserver
10.47
KB
-rwxr-xr-x
2022-05-16 17:47
setupmailserver
9.55
KB
-rwxr-xr-x
2022-05-16 17:46
setupnameserver
12.49
KB
-rwxr-xr-x
2025-04-01 22:56
shrink_modsec_ip_database
12.97
KB
-rwxr-xr-x
2022-05-16 17:46
simpleps
3.05
KB
-rwxr-xr-x
2022-05-16 17:47
slurp_exim_mainlog
5.78
KB
-rwxr-xr-x
2022-05-16 17:47
smartcheck
15.13
KB
-rwxr-xr-x
2022-05-16 17:47
smtpmailgidonly
8.15
KB
-rwxr-xr-x
2023-03-11 10:28
snapshot_prep
5.88
KB
-rwxr-xr-x
2023-03-11 10:28
spamassassin_dbm_cleaner
5.85
KB
-rwxr-xr-x
2022-09-24 10:10
spamassassindisable
3.74
KB
-rwxr-xr-x
2022-09-24 10:10
spamboxdisable
2.27
KB
-rwxr-xr-x
2022-09-24 10:10
sshcontrol
14.38
KB
-rwxr-xr-x
2022-05-16 17:47
ssl_crt_status
3.84
KB
-rwxr-xr-x
2022-05-16 17:47
suspendacct
18.01
KB
-rwxr-xr-x
2023-05-06 10:14
suspendmysqlusers
4.78
KB
-rwxr-xr-x
2025-04-01 22:56
swapip
3.82
KB
-rwxr-xr-x
2022-05-16 17:47
sync-mysql-users-from-grants
1.2
KB
-rwxr-xr-x
2022-05-16 17:46
sync_child_accounts
1.77
KB
-rwxr-xr-x
2022-05-16 17:47
sync_contact_emails_to_cpanel_users_files
1.14
KB
-rwxr-xr-x
2022-09-24 10:10
synccpaddonswithsqlhost
6.59
KB
-rwxr-xr-x
2022-05-16 17:47
synctransfers
1.92
KB
-rwxr-xr-x
2022-05-16 17:47
syslog_check
1.36
KB
-rwxr-xr-x
2022-05-16 17:46
sysup
645
B
-rwxr-xr-x
2022-05-16 17:46
test_sa_compiled
1.07
KB
-rwxr-xr-x
2022-05-16 17:47
transfer_account_as_user
2.34
KB
-rwxr-xr-x
2022-05-16 17:46
transfer_accounts_as_root
4.76
KB
-rwxr-xr-x
2022-05-16 17:46
transfer_in_progress
3.08
KB
-rwxr-xr-x
2022-05-16 17:46
transfer_in_progress.pod
312
B
-rw-r--r--
2017-06-12 18:25
transfermysqlusers
9.72
MB
-rwx------
2025-10-17 11:30
try-later
7.95
KB
-rwxr-xr-x
2022-05-16 17:46
unblockip
667
B
-rwxr-xr-x
2022-05-16 17:46
uninstall_cpanel_analytics
1.2
KB
-rwxr-xr-x
2022-05-16 17:46
uninstall_dovecot_fts
562
B
-rwxr-xr-x
2022-05-16 17:47
uninstall_plugin
2.84
KB
-rwxr-xr-x
2022-09-24 10:10
unlink_service_account
2.62
KB
-rwxr-xr-x
2022-05-16 17:46
unpkgacct
4.6
KB
-rwxr-xr-x
2022-05-16 17:46
unslavenamedconf
863
B
-rwxr-xr-x
2022-05-16 17:47
unsuspendacct
17.8
KB
-rwxr-xr-x
2025-04-01 22:56
unsuspendmysqlusers
7.1
KB
-rwxr-xr-x
2025-04-01 22:57
upcp
31.76
KB
-rwxr-xr-x
2025-04-01 22:56
upcp-running
2.7
KB
-rwxr-xr-x
2022-05-16 17:46
upcp.static
716.78
KB
-rwxr-xr-x
2025-11-06 12:30
update-packages
5.07
KB
-rwxr-xr-x
2025-04-01 22:56
update_apachectl
480
B
-rwxr-xr-x
2022-05-16 17:46
update_db_cache
430
B
-rwxr-xr-x
2022-05-16 17:47
update_dkim_keys
1.45
KB
-rwxr-xr-x
2022-05-16 17:46
update_exim_rejects
1.21
KB
-rwxr-xr-x
2022-05-16 17:46
update_existing_mail_quotas_for_account
4.78
KB
-rwxr-xr-x
2022-05-16 17:46
update_feature_flags
957
B
-rwxr-xr-x
2025-04-01 22:56
update_known_proxy_ips
1002
B
-rwxr-xr-x
2022-05-16 17:46
update_local_rpm_versions
4.56
KB
-rwxr-xr-x
2023-03-11 10:28
update_mailman_cache
8.34
KB
-rwxr-xr-x
2022-05-16 17:46
update_mysql_systemd_config
1.25
KB
-rwxr-xr-x
2022-05-16 17:47
update_neighbor_netblocks
487
B
-rwxr-xr-x
2022-05-16 17:46
update_sa_config
2.14
KB
-rwxr-xr-x
2022-05-16 17:46
update_spamassassin_config
10.73
KB
-rwxr-xr-x
2023-03-11 10:28
update_users_jail
691
B
-rwxr-xr-x
2022-05-16 17:46
update_users_vhosts
801
B
-rwxr-xr-x
2022-05-16 17:47
updatedomainips
605
B
-rwxr-xr-x
2022-05-16 17:46
updatenameserverips
1.66
KB
-rwxr-xr-x
2022-05-16 17:46
updatenow
5.18
KB
-rwxr-xr-x
2022-09-24 10:10
updatenow.static
1.97
MB
-rwxr-xr-x
2025-11-06 12:30
updatesigningkey
1.95
KB
-rwxr-xr-x
2022-05-16 17:47
updatessldomains
1.81
KB
-rwxr-xr-x
2022-05-16 17:46
updatesupportauthorizations
2.49
KB
-rwxr-xr-x
2022-05-16 17:46
updateuserdatacache
2.47
KB
-rwxr-xr-x
2022-05-16 17:46
updateuserdomains
774
B
-rwxr-xr-x
2022-05-16 17:47
upgrade_bandwidth_dbs
2.22
KB
-rwxr-xr-x
2022-05-16 17:47
upgrade_subaccount_databases
2.73
KB
-rwxr-xr-x
2022-05-16 17:46
userdata_wildcard_cleanup
5.74
KB
-rwxr-xr-x
2022-05-16 17:47
userdirctl
5.01
KB
-rwxr-xr-x
2022-05-16 17:46
validate_sshkey_passphrase
1.21
KB
-rwxr-xr-x
2022-05-16 17:46
verify_api_spec_files
757
B
-rwxr-xr-x
2022-05-16 17:47
verify_pidfile
1.96
KB
-rwxr-xr-x
2022-05-16 17:46
verify_vhost_includes
7.34
KB
-rwxr-xr-x
2022-09-24 10:10
vps_optimizer
7.82
KB
-rwxr-xr-x
2022-05-16 17:46
vzzo-fixer
725
B
-rwxr-xr-x
2022-05-16 17:46
whmlogin
2.33
KB
-rwxr-xr-x
2022-05-16 17:46
whoowns
1.13
KB
-rwxr-xr-x
2017-06-12 18:25
wwwacct
26.95
MB
-rwx------
2025-10-17 11:30
wwwacct2
88
B
-rwxr-xr-x
2017-06-12 18:25
xfer_rcube_schema_migrate.pl
2.4
KB
-rwxr-xr-x
2022-05-16 17:47
xfer_rcube_uid_resolver.pl
1.8
KB
-rwxr-xr-x
2022-05-16 17:46
xferpoint
3.13
KB
-rwxr-xr-x
2022-05-16 17:46
xfertool
16.23
KB
-rwxr-xr-x
2025-04-01 22:56
zoneexists
800
B
-rwxr-xr-x
2022-05-16 17:46
Save
Rename
#!/usr/local/cpanel/3rdparty/bin/perl # cpanel - scripts/cpbackup Copyright 2022 cPanel, L.L.C. # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited use strict; use Try::Tiny; use Capture::Tiny (); use Cwd (); use Cpanel::ExitValues::rsync (); use Cpanel::PwCache::Build (); use Cpanel::SafeDir::MK (); use Cpanel::LoadFile (); use Cpanel::BackupMount (); use Cpanel::Backup::SystemResources (); use Cpanel::Hostname (); use Cpanel::Binaries (); use Cpanel::OSSys (); use Cpanel::OSSys::Capabilities (); use Cpanel::CpuWatch (); use Cpanel::Exception (); use Cpanel::Logger (); use Cpanel::FileUtils::TouchFile (); use Cpanel::FileUtils::Copy (); use Cpanel::FileUtils::Move (); use Cpanel::Config::Backup (); use Cpanel::Config::LoadConfig (); use Cpanel::Config::FlushConfig (); use Cpanel::Config::LoadCpConf (); use Cpanel::Config::LoadCpUserFile (); use Cpanel::Config::IPs::RemoteDNS (); use Cpanel::Config::IPs::RemoteMail (); use Cpanel::Config::Users (); use Cpanel::ConfigFiles (); use Cpanel::Kill::Single (); use Cpanel::Mailman::Filesys (); use Cpanel::MysqlUtils::Dir (); use Cpanel::SafeRun::Errors (); use Cpanel::SimpleSync (); use Cpanel::Tar (); use Cpanel::IONice (); use Cpanel::Gzip::Config (); use Cpanel::Usage (); use Cpanel::Backup::Sync (); use Cpanel::Update::InProgress (); use Cpanel::Locale (); use Cpanel::ConfigFiles::Apache (); use Cpanel::StringFunc::Trim (); use Cpanel::Waitpid (); use Cpanel::FtpUtils::ResponseCodes (); use Cpanel::SignalManager (); use Cpanel::OS (); # # These constants identify the backup type # which is running and to name the pid file # We'll be passing this to the set of common functions # used by the old and new backup systems to avoid collisions # use constant BACKUP_ID => Cpanel::Backup::Sync::BACKUP_TYPE_OLD; use constant BACKUP_ID_OTHER => Cpanel::Backup::Sync::BACKUP_TYPE_NEW; my $start_time = time(); my $apacheconf = Cpanel::ConfigFiles::Apache->new(); my $logger = Cpanel::Logger->new(); our $VERSION = 2.1; $Cpanel::BackupMount::VERBOSE = 1; $ENV{'PATH'} .= ":/sbin"; our $logdir = '/usr/local/cpanel/logs/cpbackup'; my $force = 0; my $debug = 0; my $allow_override = 0; my $monthly = 0; my $weekly = 0; my $locale; my $LAST_CPUSYSTEM_ERROR; $locale ||= Cpanel::Locale->get_handle(); my %opts = ( 'force' => \$force, 'debug' => \$debug, 'monthly' => \$monthly, 'weekly' => \$weekly, 'allow-override' => \$allow_override, ); Cpanel::Usage::wrap_options( \@ARGV, \&usage, \%opts ); my $host = Cpanel::Hostname::gethostname(); my %CPCONF = Cpanel::Config::LoadCpConf::loadcpconf(); if ( Cpanel::Update::InProgress->is_on() ) { $logger->warn("An update is in progress. Backups are disabled at this time."); exit 1; } # # Handle the case where another instance of the script # is already running # Cpanel::Backup::Sync::handle_already_running( BACKUP_ID, $logdir, $logger ) or exit 1; # Load the configuration and do some preliminary checks as to whether we # actually need to run before trying to wait for the other backup to complete # and warning the user. my %CONF = Cpanel::Config::Backup::load(); if ( $CONF{'BACKUPENABLE'} ne "yes" ) { if ( -t \*STDOUT ) { print STDERR "[cpbackup] Backup Not Enabled (This can be adjusted in WHM => Backup => Legacy Backup Configuration)\n"; } exit 1; } if ( $CONF{'BACKUPENABLE'} ne "restoreonly" && $CONF{'BACKUPENABLE'} ne "yes" ) { print STDERR "[cpbackup] Backup Not Enabled (restore only) (This can be adjusted in WHM => Backup => Legacy Backup Configuration)\n"; exit 1; } if ( $CONF{'BACKUPCHECK'} ne "yes" ) { print STDERR "[cpbackup] Backup must be re-enabled in your WHM (This can be adjusted in WHM => Backup => Legacy Backup Configuration)\n"; exit 1; } # # If the other backup type is running wait for it to finish, # then flag that we are running so the other backup type can not # start # my $rc = Cpanel::Backup::Sync::set_backup_as_running_after_other_finishes( BACKUP_ID, BACKUP_ID_OTHER, time(), $logger ); if ( $rc == Cpanel::Backup::Sync::OTHER_TYPE_RUNNING ) { print STDERR "[backup] Unable start backup script"; require Cpanel::iContact::Class::Backup::Failure; require Cpanel::Notify; Cpanel::Notify::notification_class( 'class' => 'Backup::Failure', 'application' => 'Backup::Failure', 'constructor_args' => [ 'origin' => 'Legacy cPanel Backup System', 'start_time' => $start_time, 'end_time' => time(), 'reason' => $locale->maketext('The system could not complete the backup because legacy and current backup processes may not run concurrently, and the first backup process has not finished.') ] ); exit 1; } if ( $rc != Cpanel::Backup::Sync::SUCCESS ) { print STDERR "[backup] Unable start backup script"; require Cpanel::iContact::Class::Backup::Failure; require Cpanel::Notify; Cpanel::Notify::notification_class( 'class' => 'Backup::Failure', 'application' => 'Backup::Failure', 'constructor_args' => [ 'origin' => 'Legacy cPanel Backup System', 'start_time' => $start_time, 'end_time' => time(), 'reason' => $locale->maketext( 'The system could not complete the backup because a test of “[_1]” resulted in an error.', '/bin/backup' ) ] ); exit 1; } # # If stats are running, request that they pause # if ( $CPCONF{'nocpbackuplogs'} ) { Cpanel::Backup::Sync::pause_stats_if_needed($logger); } my $gzip_cfg = Cpanel::Gzip::Config->load(); my $gzip_bin = $gzip_cfg->{'bin'}; if ( !-x $gzip_bin ) { $logger->info('Unable to locate suitable gzip binary'); exit 1; } my $rsync_bin = Cpanel::Binaries::path('rsync'); if ( !-x $rsync_bin ) { $logger->info('Unable to locate suitable rsync binary'); exit 1; } my $tarcfg = Cpanel::Tar::load_tarcfg(); my ( $status, $message ) = Cpanel::Tar::checkperm(); exit 1 if !$status; # No need to show message here, handled in checkperm routine my $tar_bin = $tarcfg->{'bin'}; my $now = time; my $rsyncopts = '-rlptD'; #recusive, copy symlinks as symlinks, preserve permissions, #preserve times, preserve devices $ENV{'CPBACKUP'} = 1; if ( !$CPCONF{'skipnotifyacctbackupfailure'} ) { $ENV{'CPBACKUP_NOTIFY_FAIL'} = 1; } my $CAPABILITIES = Cpanel::OSSys::Capabilities->load; my $pkgacct = -x '/usr/local/cpanel/bin/pkgacct' ? '/usr/local/cpanel/bin/pkgacct' : '/usr/local/cpanel/scripts/pkgacct'; if ($allow_override) { if ( -e '/var/cpanel/lib/Whostmgr/Pkgacct/pkgacct' && -x _ ) { $pkgacct = '/var/cpanel/lib/Whostmgr/Pkgacct/pkgacct'; } } my $has_link_dest = 0; if ( $CONF{'BACKUPINC'} eq 'yes' && $CONF{'LINKDEST'} && ( $CONF{'LINKDEST'} eq 'yes' || $CONF{'LINKDEST'} eq '1' ) ) { my $rsync_help = Cpanel::SafeRun::Errors::saferunallerrors( $rsync_bin, '--help' ); $has_link_dest = ( $rsync_help =~ /link-dest/ ? 1 : 0 ); } if ( ( !exists $CONF{'PREBACKUP'} || $CONF{'PREBACKUP'} eq '-1' || $CONF{'PREBACKUP'} eq '' ) && -e '/usr/local/cpanel/scripts/precpbackup' && -x _ ) { if ( !exists $CONF{'PREBACKUP'} ) { require Cpanel::Redirect; my $url_host = Cpanel::Redirect::getserviceSSLdomain('cpanel') || $host; if ( my $pid = fork() ) { Cpanel::Waitpid::sigsafe_blocking_waitpid($pid); if ( $? && $? & 127 ) { my $signum = $? & 127; print STDERR "[cpbackup] WARNING: Process $pid died from signal $signum!\n"; } } else { require Cpanel::Notify; Cpanel::Notify::notification_class( 'class' => 'Backup::PreBackupNotice', 'application' => 'Legacy cPanel Backup System', 'status' => 'prebackup deprecation', 'priority' => 2, 'interval' => 60 * 60 * 24, 'constructor_args' => [ 'origin' => 'Legacy cPanel Backup System' ] ); exit(0); } } if ( -t STDIN ) { print "[cpbackup] Executing user defined pre backup script (/usr/local/cpanel/scripts/precpbackup) [LEGACY].\n"; } system '/usr/local/cpanel/scripts/precpbackup'; $CONF{'PREBACKUP'} = 0; # Prevent from running again } if ( exists $CONF{'GZIPRSYNCOPTS'} ) { $ENV{'GZIP'} .= $CONF{'GZIPRSYNCOPTS'}; } else { $CONF{'GZIPRSYNCOPTS'} = $gzip_cfg->{'rsyncable'} ? '--rsyncable' : ''; $ENV{'GZIP'} .= $CONF{'GZIPRSYNCOPTS'}; Cpanel::Config::Backup::save( \%CONF ); } $ENV{'pkgacct-cpbackup'} = 1; #BACKUPDIR /backup #BACKUPINT daily #BACKUPENABLE yes #BACKUPCHECK yes #BACKUPMOUNT no #BACKUPINC no #BACKUPFILES yes #BACKUPACCTS #DIEIFNOTMOUNTED no #BACKUPDAYS 0,1,2,3,4,5,6 #BACKUPLOGS no #MYSQLBACKUP accounts #BACKUPTYPE normal,ftp if ( $> == 0 ) { $ENV{'USER'} = 'root'; $ENV{'HOME'} = '/root'; } # my %SKIPUSERS; # if ( open my $userskip_fh, '<', '/etc/cpbackup-userskip.conf' ) { # while (<$userskip_fh>) { # chomp; # $SKIPUSERS{$_} = 1; # } # close $userskip_fh; # } my @FILES = ( qw( /etc/exim.conf /etc/exim.conf.local /etc/exim.conf.localopts /etc/namedb/named.conf /etc/rc.conf /etc/named.conf /etc/proftpd.conf /etc/pure-ftpd.conf /etc/localdomains /etc/httpd/conf/httpd.conf /usr/local/apache/conf/httpd.conf /etc/group /etc/shadow /etc/digestshadow /etc/master.passwd /etc/passwd /etc/fstab /root/.my.cnf /etc/ips /etc/reservedips /etc/reservedipreasons /etc/wwwacct.conf /etc/remotedomains /etc/rndc.conf /etc/secondarymx /etc/senderverifybypasshosts /etc/spammeripblocks /etc/blocked_incoming_email_countries /etc/blocked_incoming_email_country_ips /etc/blocked_incoming_email_domains /etc/cpanel_exim_system_filter /etc/global_spamassassin_enable /etc/spammers /etc/my.cnf /etc/dovecot/sni.conf /var/cpanel/greylist/conf /var/cpanel/greylist/greylist.sqlite /var/cpanel/mysql/remote_profiles/profiles.json ), $apacheconf->file_conf(), Cpanel::Config::IPs::RemoteDNS->PATH(), Cpanel::Config::IPs::RemoteMail->PATH(), ); my @DIRS = ( $Cpanel::ConfigFiles::VALIASES_DIR, $Cpanel::ConfigFiles::VDOMAINALIASES_DIR, $Cpanel::ConfigFiles::VFILTERS_DIR, $Cpanel::ConfigFiles::FTP_PASSWD_DIR, Cpanel::Mailman::Filesys::MAILMAN_DIR(), Cpanel::OS::user_crontab_dir(), Cpanel::OS::dns_named_basedir(), qw( /etc/cpanel /etc/namedb /etc/ssl /usr/share/ssl /var/cpanel /var/cron/tabs /var/lib/named/chroot/var/named/master /var/lib/rpm /var/log/bandwidth /var/spool/cron /var/spool/fcron /var/ssl ), ); if ( $CONF{'BACKUPDAYS'} ne "" ) { my @BACKUPDAYS = split( /\,/, $CONF{'BACKUPDAYS'} ); my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime($now); my $backupthisday = 0; foreach (@BACKUPDAYS) { if ( $wday eq $_ ) { $backupthisday = 1; } } if ( !$backupthisday && !$force ) { print STDERR "[cpbackup] Backups are not scheduled to run today (This can be adjusted in WHM => Backup => Legacy Backup Configuration)\n"; exit 1; } } my $basedir = $CONF{'BACKUPDIR'}; # Create log dir and rotate log files setup_and_clean_logs(); my $log_file_path = Cpanel::Backup::Sync::log_file_path( $logdir, $now ); my ( $SIGNAL_MANAGER, $at_perl_end ); if ( !$debug ) { ( $SIGNAL_MANAGER, $at_perl_end ) = Cpanel::Backup::Sync::fork_and_redirect_output( BACKUP_ID, $logdir, $now, $logger, \&send_message ); } $ENV{'CPBACKUP_LOGFILE'} = $log_file_path; if ( $CONF{'BACKUPTYPE'} eq 'ftp' ) { my $ftpuser = $CONF{'BACKUPFTPUSER'}; my $ftppass = $CONF{'BACKUPFTPPASS'}; if ( !defined($ftpuser) || $ftpuser eq '' ) { my $status = 'FTP user for backups is not defined.'; my $subject = $status; exit_STDERR_log_and_notify( $status, $subject, $locale->maketext( 'The “[_1]” of the Legacy Backup System is set to “[_2]”, but the [asis,FTP] user is not defined.', $locale->maketext('Backup Type'), $locale->maketext('Remote FTP (Accounts Only)'), ), ); } elsif ( !defined($ftppass) || $ftppass eq '' ) { my $status = "FTP password for $ftpuser is not defined."; my $subject = $status; exit_STDERR_log_and_notify( $status, $subject, $locale->maketext( 'The “[_1]” of the Legacy Backup System is set to “[_2]”, but the [asis,FTP] password for “[_3]” is not defined.', $locale->maketext('Backup Type'), $locale->maketext('Remote FTP (Accounts Only)'), $ftpuser, ), ); } my $net_ftp_ok = 0; eval { require Net::FTP; $net_ftp_ok = 1; }; if ( !$net_ftp_ok ) { my $status = 'loading Net::FTP failed'; my $subject = qq{Remote FTP backup failed because Net::FTP could not be loaded on $host}; exit_STDERR_log_and_notify( $status, $subject, $locale->maketext( 'The “[_1]” of the Legacy Backup System is set to “[_2]”, but the backup failed because “[asis,Net::FTP]” could not be loaded on “[_3]”.', $locale->maketext('Backup Type'), $locale->maketext('Remote FTP (Accounts Only)'), $host, ), ); } my $ftptimeout = $CONF{'BACKUPFTPTIMEOUT'} || 120; my $ftppassive = ( $CONF{'BACKUPFTPPASSIVE'} eq 'yes' ); my $ftphost = $CONF{'BACKUPFTPHOST'}; my $ftp = Net::FTP->new( $ftphost, Debug => 1, Passive => $ftppassive, Timeout => $ftptimeout ); unless ($ftp) { my $status = "Unable to connect to remote FTP server ($ftphost)."; my $subject = qq{Remote FTP backup on $host failed because unable to connect to remote FTP server ($ftphost)}; exit_STDERR_log_and_notify( $status, $subject, $locale->maketext( 'Remote [asis,FTP] backup on “[_1]” failed because the system was unable to connect to the remote [asis,FTP] server ([_2]).', $host, $ftphost ), ); } if ( !$ftp->login( $ftpuser, $ftppass ) ) { $ftp->quit(); my $status = 'Unable to login to remote FTP server.'; my $subject = $status; exit_STDERR_log_and_notify( $status, $subject, $locale->maketext( 'Remote [asis,FTP] backup on “[_1]” failed because the server was unable to log into the remote [asis,FTP] server, [_2], with the provided credentials.', $host, $ftphost ), ); } $ftp->quit(); mkdir( "/home/cpbackuptmp", 0711 ); chmod( 0711, "/home/cpbackuptmp" ); $basedir = "/home/cpbackuptmp"; $CONF{'BACKUPINC'} = "no"; $CONF{'BACKUPFILES'} = "no"; $CONF{'BACKUPACCTS'} = "yes"; $CONF{'BACKUPMOUNT'} = "no"; $CONF{'DIEIFNOTMOUNTED'} = "no"; } my $original_child_pid = $$; my $basemount = $basedir; my $need_to_mount_backup; $need_to_mount_backup = !Cpanel::BackupMount::backup_disk_is_mounted($basemount) if ( $CONF{'BACKUPMOUNT'} eq 'yes' ); if ($need_to_mount_backup) { Cpanel::BackupMount::mount_backup_disk( $basemount, 'cpbackup', 86400 ); } die_if_not_mounted_check(); if ( !$basedir ) { if ( !-t STDIN ) { require Cpanel::iContact::Class::Backup::Failure; require Cpanel::Notify; Cpanel::Notify::notification_class( 'class' => 'Backup::Failure', 'application' => 'Backup::Failure', 'constructor_args' => [ 'origin' => 'Legacy cPanel Backup System', 'start_time' => $start_time, 'end_time' => time(), 'reason' => $locale->maketext('The system could not complete the backup because the configuration does not specify the backup directory.') ] ); } print STDERR "[cpbackup] Backup failed! Base directory for backups not set!\n"; exit 1; } chmod( 0711, $basedir ); $basedir .= '/cpbackup'; $basedir =~ s{//}{/}; Cpanel::SafeDir::MK::safemkdir( $basedir, 0711 ); chmod( 0711, $basedir ); Cpanel::OSSys::nice(18); # needs to be one higher for cpuwatch if ( $CAPABILITIES->capable_of('ionice') ) { if ( Cpanel::IONice::ionice( 'best-effort', exists $CPCONF{'ionice_cpbackup'} ? $CPCONF{'ionice_cpbackup'} : 6 ) ) { print "[cpbackup] Setting I/O priority to reduce system load: " . Cpanel::IONice::get_ionice() . "\n"; } } if ($has_link_dest) { print "[cpbackup] EXPERIMENTAL Hard Linking enabled (link-dest)\n"; } if ( $CONF{'PREBACKUP'} && -e '/usr/local/cpanel/scripts/precpbackup' && -x _ ) { print "[cpbackup] Executing user defined pre backup script (/usr/local/cpanel/scripts/precpbackup).\n"; system '/usr/local/cpanel/scripts/precpbackup'; } # # If precpbackup unmounts the disk, mount it again # if ( $CONF{'BACKUPMOUNT'} eq 'yes' && !Cpanel::BackupMount::backup_disk_is_mounted($basemount) ) { Cpanel::BackupMount::mount_backup_disk( $basemount, 'cpbackup', 86400 ); die_if_not_mounted_check(); } my %BACKUP_TTLS = ( 'monthly' => 29, 'weekly' => 6, 'daily' => .5 ); my ( @backups_to_run, @backups_to_skip ); # We are using an array becuse the order of the backups matter # when we push them in below the first backup will be the one we run # anything after the first are just retention backups which may or may be due # to be copied from the backup we just made. # # Pick the first backup based on the BACKUPINT setting # if ( exists $BACKUP_TTLS{ $CONF{'BACKUPINT'} } ) { if ( $force || !-e $basedir . '/' . $CONF{'BACKUPINT'} || isolderthan( $BACKUP_TTLS{ $CONF{'BACKUPINT'} }, $basedir . '/' . $CONF{'BACKUPINT'} ) ) { push @backups_to_run, $CONF{'BACKUPINT'}; } else { push @backups_to_skip, $CONF{'BACKUPINT'}; } } # additionnal backups should be treated only when performing the original BAKUPINT # if not we will not preserve the hardlinks when launch multiple times # you should use --force option for multiple launch if (@backups_to_run) { # # If we are doing daily backups we have the option to retain weekly backups # if ( $CONF{'BACKUPINT'} eq "daily" && $CONF{'BACKUPRETWEEKLY'} ) { if ( !-e "${basedir}/weekly" || isolderthan( $BACKUP_TTLS{'weekly'}, "${basedir}/weekly" || $weekly ) ) { push @backups_to_run, 'weekly'; } else { push @backups_to_skip, 'weekly'; } } # # If we are doing daily or weekly backups we have the option to retain monthly backups # if ( ( $CONF{'BACKUPINT'} eq "weekly" || $CONF{'BACKUPINT'} eq "daily" ) && $CONF{'BACKUPRETMONTHLY'} ) { if ( !-e "${basedir}/monthly" || isolderthan( $BACKUP_TTLS{'monthly'}, "${basedir}/monthly" || $monthly ) ) { push @backups_to_run, 'monthly'; } else { push @backups_to_skip, 'monthly'; } } } #BACKUPLOGS no #MYSQLBACKUP accounts if ( $CONF{'MYSQLBACKUP'} eq "both" || $CONF{'MYSQLBACKUP'} eq 'dir' ) { backup_all_mysql_databases( \%CONF ); } # # Only send the message if there are backups to run # my $send_message = ( @backups_to_run ? 1 : 0 ); my ( $rsync_err_str, $rsync_stderr ); my $user_error_map; if (@backups_to_run) { print "[cpbackup] The following backups will be updated: " . join( ',', @backups_to_run ) . "\n"; my $current_backup = $backups_to_run[0]; my $curr_backup_dir = "$basedir/$current_backup"; Cpanel::SafeDir::MK::safemkdir( $curr_backup_dir, 0711 ) if ( !-e $curr_backup_dir ); chmod( 0711, $curr_backup_dir ); $user_error_map = backupaccts( $curr_backup_dir, \@backups_to_run ); # we include the list of backups to run so we can avoid # having to do the backup process for each backup when ftping update_last_run_time($curr_backup_dir); # # Make a copy of the current_backup (BACKUPINT setting) into the next type we need to retain # shift(@backups_to_run); # the first one is the kind of backup we are running # The next are the ones we need to keep (they are only pushed in if we need to make a copy) while ( my $retention_backup = shift @backups_to_run ) { # We are shifting them out as they are done # so we know they have been completed next if ( !$retention_backup ); print "[cpbackup] Copying $current_backup backups to $retention_backup backups for retention\n"; my $target_dir = "$basedir/$retention_backup"; my @rsync_opts = ( $rsyncopts, '--delete', ( $has_link_dest ? ( "--link-dest=../$current_backup", "--exclude=$curr_backup_dir/cpbackupstatus.cfg", ) : () ), "$curr_backup_dir/", $target_dir, ); my $rsync_exit_code; ( $rsync_stderr, $rsync_exit_code ) = Capture::Tiny::tee_stderr( sub { cpusystem( $rsync_bin, @rsync_opts ) }, ); my $rsync_status = $rsync_exit_code ? Cpanel::ExitValues::rsync->number_to_string($rsync_exit_code) : q<>; if ($has_link_dest) { if ( $rsync_exit_code != 0 ) { $rsync_err_str = "Incremental hard link copy of $current_backup backups to $retention_backup backups failed because of an error: $rsync_status"; } else { unlink "$target_dir/cpbackupstatus.cfg" if -e "$target_dir/cpbackupstatus.cfg"; Cpanel::FileUtils::Copy::safecopy( "$curr_backup_dir/cpbackupstatus.cfg", "$target_dir/cpbackupstatus.cfg" ); } } elsif ( $rsync_exit_code != 0 ) { $rsync_err_str = "Incremental copy of $current_backup backups to $retention_backup backups failed because of an error: $rsync_status"; } if ($rsync_err_str) { print STDERR "[cpbackup] $rsync_err_str\n"; } # case 42741: no need to update the file again as it will be copied from the $current_backup #update_last_run_time( $basedir . '/' . $retention_backup ); last; # Only do one per run so at least we have one day where monthly and weekly backups are not the same at the end of the month } if (@backups_to_run) { print STDERR "[cpbackup] The following backups will be updated next time cpbackup runs: " . join( ',', @backups_to_run ) . "\n"; # we do not want to cobber the monthly backups # at the end of the month so we will wait till the next run } } if (@backups_to_skip) { print "[cpbackup] The following backups were already up to date: " . join( ',', @backups_to_skip ) . "\n"; } if ( -e '/usr/local/cpanel/scripts/postcpbackup' && -x _ && ( !exists $CONF{'POSTBACKUP'} || $CONF{'POSTBACKUP'} ) ) { print "[cpbackup] Executing user defined post backup script (/usr/local/cpanel/scripts/postcpbackup).\n"; system '/usr/local/cpanel/scripts/postcpbackup'; } # unmount the disk if it was initially unmounted if ($need_to_mount_backup) { Cpanel::BackupMount::unmount_backup_disk( $basemount, 'cpbackup' ); } Cpanel::Backup::Sync::clean_up_pid_files(BACKUP_ID); my $complete_localtime = localtime(); print "[cpbackup] Completed at $complete_localtime\n"; sub send_message { my ($signal) = @_; $signal ||= 0; if ($send_message) { my $major_error; # Parse the log for known problems to highlight. #Just take the first one due to space restraints in subject line. if ( open( my $log_file, '<', $log_file_path ) ) { while (<$log_file>) { if (m/<<<\s552\s(.*)/) { $major_error = $locale->maketext("The backup destination server has exceeded storage allocation (for current directory or dataset)."); last; } elsif (m/<<<\s452\s(.*)/) { $major_error = $locale->maketext("The backup destination server has insufficient storage space."); last; } } close($log_file); } my @transport_errors = (); if ( keys %$user_error_map ) { for my $user ( sort keys %$user_error_map ) { for my $target_type ( sort keys %{ $user_error_map->{$user}{'transport'} } ) { push @transport_errors, [ $user, $target_type, $user_error_map->{$user}{'transport'}{$target_type}{'error_message'}, ]; } } } my @account_errors = (); if ( keys %$user_error_map ) { for my $user ( sort keys %$user_error_map ) { if ( $user_error_map->{$user}{'account'} ) { push @account_errors, [ $user, $user_error_map->{$user}{'account'}{'error_message'} ]; } } } my @local_copy_errors = ( $rsync_err_str ? ( [ $rsync_err_str => $rsync_stderr ] ) : () ); require Cpanel::Notify; my @attach_files = ( { "name" => "${now}.log.txt", "content" => Cpanel::LoadFile::loadfile_r($log_file_path), 'number_of_preview_lines' => 25, }, ); my $had_error = $major_error || @account_errors || @transport_errors || @local_copy_errors; my $class = $had_error ? 'Backup::PartialFailure' : 'Backup::Success'; print "[cpbackup] Final state is $class ($signal)\n"; Cpanel::Notify::notification_class( 'application' => "Legacy cPanel Backup System", 'class' => $class, 'status' => '', 'priority' => 2, 'interval' => 1, # Always notify 'constructor_args' => [ 'origin' => "Legacy cPanel Backup System", is_legacy => 1, 'start_time' => $start_time, 'end_time' => time(), major_error => $major_error, transport_errors => \@transport_errors, account_errors => \@account_errors, local_copy_errors => \@local_copy_errors, 'attach_files' => \@attach_files, 'signal' => $signal, 'log_file_path' => $log_file_path, ], ); } } sub isolderthan { my ( $days, $file ) = @_; return 1 if !-e $file; my $last_run_time = ( stat($file) )[9]; # We want the trust the earliest time so we do not miss out on a backup. Its better to backup again # if we are unsure. We now create a cpbackupstatus.cfg if it is missing if ( -e $file . '/cpbackupstatus.cfg' ) { my $backup_status_ref = Cpanel::Config::LoadConfig::loadConfig( $file . '/cpbackupstatus.cfg', {}, '=' ); # Always take the oldest date if ( exists $backup_status_ref->{'last_run_time'} && $backup_status_ref->{'last_run_time'} && $backup_status_ref->{'last_run_time'} < $last_run_time ) { $last_run_time = $backup_status_ref->{'last_run_time'}; } } else { my $backup_status_ref = { 'last_run_time' => $last_run_time }; Cpanel::Config::FlushConfig::flushConfig( $file . '/cpbackupstatus.cfg', $backup_status_ref, '=' ); } my $days_old = ( time() - ($last_run_time) ) / ( 60 * 60 * 24 ); #9 =mtime print "[cpbackup] backup point $file is " . sprintf( '%0.2f', $days_old ) . " days old\n"; return ( ( $days_old < 0 || $days_old > $days ) ? 1 : 0 ); #case 19450:: now time warp safe } sub update_last_run_time { my $dir = shift; my $time = shift || time(); my $backup_status_ref; my $cfg_file = $dir . '/cpbackupstatus.cfg'; if ( -e $cfg_file ) { $backup_status_ref = Cpanel::Config::LoadConfig::loadConfig( $cfg_file, {}, '=' ); #This file gets unlink()ed immediately down below. #It’s conceivable that this is here in event of failure in #flushConfig(), except flushConfig() doesn’t throw exceptions. #So, it’s unclear what’s intended. TODO FIXME XXX Cpanel::FileUtils::Move::safemv( $cfg_file, "$cfg_file.bak" ); } $backup_status_ref->{'last_run_time'} = $time; Cpanel::Config::FlushConfig::flushConfig( $cfg_file, $backup_status_ref, '=' ); unlink "$cfg_file.bak" if -e "$cfg_file.bak"; } sub backup_all_mysql_databases { my ($conf) = @_; my $mysqldatadir = Cpanel::MysqlUtils::Dir::getmysqldir() || '/var/lib/mysql'; while ( -l $mysqldatadir ) { $mysqldatadir = readlink($mysqldatadir); } my $rawdir = $mysqldatadir; $rawdir =~ s/\//_/g; my $basedir = $conf->{'BACKUPDIR'}; $basedir .= '/cpbackup'; my $curr_backup_dir = $basedir . '/' . $conf->{'BACKUPINT'}; my @EXCLUDES = Cpanel::Backup::SystemResources::get_excludes_args_by_path($mysqldatadir); Cpanel::SafeDir::MK::safemkdir("$curr_backup_dir/dirs") if !-d "$curr_backup_dir/dirs"; # Added exclude for /proc for chroot bind setups to prevent error messages if ( $conf->{'BACKUPINC'} eq "yes" ) { print "[cpbackup] Starting incremental MySQL database backups\n"; if ( cpusystem( $rsync_bin, $rsyncopts, @EXCLUDES, '--delete', "$mysqldatadir/", "$curr_backup_dir/dirs/$rawdir" ) != 0 ) { print STDERR "[cpbackup] Failed to perform incremental MySQL database backup\n"; } } else { print "[cpbackup] Starting full MySQL database backups\n"; if ( cpusystem( $tar_bin, '--use-compress-program=/usr/local/cpanel/bin/gzip-wrapper', '--create', '--preserve-permissions', '--file', "$curr_backup_dir/dirs/$rawdir.tar.gz", @EXCLUDES, $mysqldatadir ) == 0 ) { chmod( 0600, "$curr_backup_dir/dirs/$rawdir.tar.gz" ) if $status == 0; } else { print STDERR "[cpbackup] Failed to perform full MySQL database backup\n"; } } return; } sub backupaccts { ## no critic qw(Subroutines::ProhibitExcessComplexity) my $target = shift; my $all_targets = shift; Cpanel::FileUtils::TouchFile::touchfile($target); #if another cpbackup starts just go bye bye if ( !( $CONF{'BACKUPFILES'} eq "no" ) ) { print "[cpbackup] Running dir & file backup with target : $target\n"; if ( !-e "$target/files" ) { mkdir( "$target/files", 0700 ); } if ( !-e "$target/dirs" ) { mkdir( "$target/dirs", 0700 ); } chmod( 0700, "$target/files", "$target/dirs" ); my ( $syncstatus, $syncmessage ); foreach my $file (@FILES) { next if ( !-e $file ); my $rawfile = $file; $rawfile =~ s/\//_/g; if ( $CONF{'BACKUPINC'} eq "yes" ) { ( $syncstatus, $syncmessage ) = Cpanel::SimpleSync::syncfile( $file, "$target/files/$rawfile", 0, 1 ); } else { ( $syncstatus, $syncmessage ) = Cpanel::SimpleSync::syncfile( $file, "$target/files/$rawfile", 0, 1 ); if ( $syncstatus != 0 ) { if ( cpusystem( $gzip_bin, "-f", "$target/files/$rawfile" ) != 0 ) { print STDERR "[cpbackup] Failed to compress file $target/files/$rawfile\n"; } } } if ( $syncstatus == 0 ) { print STDERR "[cpbackup] Failed to backup $file ($syncmessage)\n"; } } foreach my $dir (@DIRS) { next if ( !-e $dir ); my $rawdir = $dir; $rawdir =~ s/\//_/g; my @EXCLUDES = Cpanel::Backup::SystemResources::get_excludes_args_by_path($dir); # Added exclude for /proc for chroot bind setups to prevent error messages if ( $CONF{'BACKUPINC'} eq "yes" ) { if ( cpusystem( $rsync_bin, $rsyncopts, @EXCLUDES, '--delete', "$dir/", "$target/dirs/$rawdir" ) != 0 ) { print STDERR "[cpbackup] Failed to perform incremental backup of $dir/ to $target/dirs/$rawdir\n"; } } else { if ( cpusystem( $tar_bin, '--use-compress-program=/usr/local/cpanel/bin/gzip-wrapper', '--create', '--preserve-permissions', '--file', "$target/dirs/$rawdir.tar.gz", @EXCLUDES, $dir ) == 0 ) { chmod( 0600, "$target/dirs/$rawdir.tar.gz" ); } else { print STDERR "[cpbackup] Failed to perform full backup of $dir/ to $target/dirs/$rawdir.tar.gz\n"; } } } } print "[cpbackup] Running account backup with target : $target\n"; #BACKUPLOGS no #MYSQLBACKUP accounts #BACKUPBWDATA yes $ENV{'pkgacct-logs'} = ( $CONF{'BACKUPLOGS'} eq "yes" ? 'yes' : 'no' ); $ENV{'pkgacct-mysql'} = ( ( $CONF{'MYSQLBACKUP'} eq "dir" || $CONF{'MYSQLBACKUP'} eq "no" ) ? 'no' : 'yes' ); $ENV{'pkgacct-psql'} = ( $CONF{'PSQLBACKUP'} eq "no" ? 'no' : 'yes' ); $ENV{'pkgacct-bwdata'} = ( $CONF{'BACKUPBWDATA'} eq "no" ? 'no' : 'yes' ); my %user_error_map = (); if ( $CONF{'BACKUPACCTS'} ne 'no' ) { Cpanel::PwCache::Build::init_passwdless_pwcache(); my @cpusers = Cpanel::Config::Users::getcpusers(); foreach my $user ( sort @cpusers ) { my $user_conf = Cpanel::Config::LoadCpUserFile::load($user); $user_conf->{'LEGACY_BACKUP'} = 0 if !exists $user_conf->{'LEGACY_BACKUP'}; next if !$user_conf->{'LEGACY_BACKUP'}; if ( $CONF{'BACKUPINC'} eq 'yes' ) { my $last_update_time = time(); utime( $last_update_time, $last_update_time, "$target/$user" ); } if ( cpusystem( $pkgacct, ( $CONF{'COMPRESSACCTS'} eq 'no' ? '--nocompress' : () ), ( $CONF{'BACKUPINC'} eq "yes" ? '--incremental' : () ), $user, $target, 'backup' ) != 0 ) { print STDERR "[cpbackup] Failed to back up account $user\n"; $user_error_map{$user}{'account'} = { 'error_message' => ( $LAST_CPUSYSTEM_ERROR || 'Failed to backup account' ) # FIXME: This is a hack to avoid refactoring cpusystem }; } else { if ( $CONF{'BACKUPTYPE'} eq 'ftp' ) { my $target_file = ( $CONF{'COMPRESSACCTS'} eq 'no' ? "$user.tar" : "$user.tar.gz" ); foreach my $remote_target (@$all_targets) { # If we are going to update multiple targets we send the file multiple times # previously we would build the backup once for every target. Now we just upload it once # instead as we know all the targets before we get here now my %ftp_error_info = ftpsend( $remote_target, $target . '/' . $target_file, $target_file ); $user_error_map{$user}{'transport'}{$remote_target} = \%ftp_error_info if keys %ftp_error_info; } unlink( $target . '/' . $target_file ); } } } } return \%user_error_map; } sub ftpsend { my ( $targetdir, $targetfile, $remotefile ) = @_; my $ftpuser = $CONF{'BACKUPFTPUSER'}; my $ftppass = $CONF{'BACKUPFTPPASS'}; my $ftproot = $CONF{'BACKUPFTPDIR'}; my $ftphost = $CONF{'BACKUPFTPHOST'}; my $ftppassive = ( $CONF{'BACKUPFTPPASSIVE'} eq 'yes' ? 1 : 0 ); my $ftptimeout = $CONF{'BACKUPFTPTIMEOUT'} || 120; my @FD = split( /\//, $targetdir ); my $backtype = $FD[$#FD]; my $ftp = Net::FTP->new( $ftphost, Debug => 1, Passive => $ftppassive, Timeout => $ftptimeout ); unless ($ftp) { my $msg = 'Unable to connect to remote FTP server.'; my $localized_message = $locale->maketext('The system was unable to connect to the remote [asis,FTP] server.'); print "$msg\n"; $logger->info($msg); return ( 'error_message' => $localized_message ); } my $status = $ftp->login( $ftpuser, $ftppass ); if ( !$status ) { my $ftp_message = $ftp->message() || get_ftp_error($ftp); $ftp_message = Cpanel::StringFunc::Trim::ws_trim($ftp_message); $ftp->quit(); my $msg = 'Unable to log in to remote FTP server.'; my $localized_message = $locale->maketext( 'The system was unable to log in to the remote [asis,FTP] server due to an error: “[_1]”', $ftp_message ); print "$msg\n"; $logger->info($msg); return ( 'error_message' => $localized_message ); } $ftp->binary(); # if $ftproot is not defined by the user, default to cpbackup if ( $ftproot eq "" ) { $ftproot = 'cpbackup'; } $ftp->mkdir($ftproot); $ftp->mkdir("${ftproot}/${backtype}"); $ftp->cwd("${ftproot}/${backtype}"); $status = $ftp->put( $targetfile, $remotefile ); if ( !$status ) { my $ftp_message = $ftp->message() || get_ftp_error($ftp); $ftp_message = Cpanel::StringFunc::Trim::ws_trim($ftp_message); $ftp->quit(); my $msg = 'Unable to upload the backup to the remote FTP server.'; my $localized_message = $locale->maketext( 'The system was unable to upload the backup to the remote [asis,FTP] server due to an error: “[_1]”', $ftp_message ); print "$msg\n"; $logger->info($msg); return ( 'error_message' => $localized_message ); } $ftp->quit; return; } sub get_ftp_error { my ($ftp_obj) = @_; my $response = Cpanel::FtpUtils::ResponseCodes::get_response_text( $ftp_obj->code() ); return $response if $response; return $locale->maketext('An unknown error occurred.'); } #Returns the exit status of the given command, or -1 if the exec() failed. #NOTE: If the command died from a signal, this will falsely report success! # sub cpusystem { my ( $program, @args ) = @_; my $sigman; $LAST_CPUSYSTEM_ERROR = ''; # FIXME: This is a hack to avoid refactoring cpusystem my $ok; try { # before_exec is slow, avoid it local $ENV{'CPBACKUP'} = 1; Cpanel::CpuWatch::run( program => $program, args => \@args, stdout => \*STDOUT, stderr => \*STDERR, after_fork => sub { my ($child_pid) = @_; my $infanticide_cr = sub { Cpanel::Kill::Single::safekill_single_pid($child_pid); }; $sigman = $SIGNAL_MANAGER || Cpanel::SignalManager->new(); for my $sig ( $sigman->FATAL_SIGNALS() ) { $sigman->push( signal => $sig, name => 'infanticide', handler => $infanticide_cr, ); } }, ); $ok = 1; } catch { NONFATAL: { last NONFATAL if !try { $_->isa('Cpanel::Exception::ProcessFailed::Error') }; my $err_code = $_->get('error_code'); my ($base_program) = $program =~ m<.*/(.+)>; if ( $base_program eq 'gtar' || $base_program eq 'gnutar' ) { $base_program = 'tar'; } my $mod = "Cpanel::ExitValues::$base_program"; last NONFATAL if !$mod->can('error_is_nonfatal_for_cpanel'); if ( $mod->error_is_nonfatal_for_cpanel($err_code) ) { $ok = 1; my $errstr = $mod->number_to_string($err_code); #warn() would print a stack trace, which we don’t want. print STDERR "$program returned a non-fatal error code, $err_code ($errstr).\n"; } } if ( !$ok ) { $LAST_CPUSYSTEM_ERROR = Cpanel::Exception::get_string($_); # FIXME: This is a hack to avoid refactoring cpusystem warn "[cpbackup] " . Cpanel::Exception::get_string($_); } } finally { if ($SIGNAL_MANAGER) { for my $sig ( $sigman->FATAL_SIGNALS() ) { $sigman->delete( name => 'infanticide', signal => $sig ); } } }; return $ok ? 0 : 1; #Historical: 0 for success, 1 for failure. } sub _nonzero_status_is_ok { return 0; } sub setup_and_clean_logs { if ( !-d $logdir ) { unlink $logdir; mkdir $logdir, 0700; } else { chmod 0700, $logdir; } if ( opendir my $logdir_dh, $logdir ) { while ( my $file = readdir($logdir_dh) ) { if ( -f $logdir . '/' . $file && ( stat(_) )[9] < ( $now - ( 86400 * 10 ) ) ) { unlink $logdir . '/' . $file; } } closedir $logdir_dh; } else { die "Unable to read directory $logdir: $!"; } } sub die_if_not_mounted_check { if ( $CONF{'DIEIFNOTMOUNTED'} eq "yes" ) { my ( $ismounted, $mountline ) = Cpanel::BackupMount::backup_disk_is_mounted($basemount); if ( !$ismounted ) { if ( !-t STDIN ) { require Cpanel::iContact::Class::Backup::Failure; require Cpanel::Notify; Cpanel::Notify::notification_class( 'class' => 'Backup::Failure', 'application' => 'Backup::Failure', 'constructor_args' => [ 'origin' => 'Legacy cPanel Backup System', 'start_time' => $start_time, 'end_time' => time(), 'reason' => $locale->maketext( 'The system could not complete the backup because it could not mount “[_1]”.', $basemount ) ] ); } print STDERR "[cpbackup] Backup failed! $basemount is not mounted!\n"; exit 1; } else { print "[cpbackup] Mount found ($mountline)\n"; } } } sub exit_STDERR_log_and_notify { my ( $status, $subject, $reason ) = @_; print STDERR "[cpbackup] $status\n"; unlink('/var/cpanel/backups_need_to_run'); require Cpanel::Notify; my $app = 'Legacy cPanel Backup System'; Cpanel::Notify::notification_class( 'class' => 'Backup::Failure', 'application' => $app, 'interval' => 1, # Always notify 'priority' => 2, 'status' => $status, 'constructor_args' => [ 'origin' => $app, 'start_time' => $start_time, 'end_time' => time(), 'reason' => $reason, ], ); $logger->info($status); exit(1); } sub usage { my $prog = $0; $prog =~ s{^.+/(.+)$}{$1}; print <<EOF; $prog [options] This script will launch the cpanel daily backup process. Modifiers Flags: --force - will update the file without checking any conditions --weekly - force current day to treat weekly backup --monthly - force current day to treat weekly backup --debug - do not fork before launching ( devel mode ) --allow-override --help - dislay this help message and exit EOF exit; } 1;