Page tree
For cPanel & WHM version 82.


Skip to end of metadata
Go to start of metadata

Overview

The cPanel & WHM installation process adds important scripts to your server’s /usr/local/cpanel/scripts directory. To run a script, enter its location on the command line.

For example, to run the update script, run the following command:

/usr/local/cpanel/scripts/upcp 

To display help for a script, add the --help argument. For example, to display help for the update script, run the following command:

/usr/local/cpanel/scripts/upcp --help

Warnings:

  • When you run a script, you must use the script's full file path, even if you run the script in the /usr/local/cpanel/scripts directory.
  • Do not use scripts in the /usr/local/cpanel/scripts directory that we do not list in this document. You may damage your server if you run those unlisted scripts.

Scripts

ScriptDescription
addpopThis script adds an email account.
auto-adjust-mysql-limits

This script updates the following MySQL® settings in the SQL section of WHM's Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings):

  • Allow cPanel & WHM to determine the best value for your MySQL open_files_limit configuration?
  • Allow cPanel & WHM to determine the best value for your MySQL max_allowed_packet configuration?
  • Allow cPanel & WHM to determine the best value for your MySQL innodb_buffer_pool_size configuration?

For more information, read our The auto-adjust-mysql-limits Script documentation.

backups_clean_metadata_for_missing_backups

This script removes the metadata for backup files that a user has manually removed from the system.

For more information, read our The backups_clean_metadata_for_missing_backups Script documentation.

backups_create_metadata

This script creates metadata files for all backup types.

For more information, read our The backups_create_metadata Script documentation.

backups_list_user_files

This script locates a user's files in compressed, uncompressed, or incremental backups. It returns all files in the backups in Comma Separated Value (CSV) format.

For more information, read our The backups_list_user_files Script documentation.

backup_restore_manager

This script manages the backup restoration queue.

For more information, read our The backup_restore_manager Script documentation.

Note:

This script exists in the /usr/local/cpanel/bin directory.

build_maxemails_config

This script sets limits on the amount of email that users can send from domains on your server.

For more information, read our Mail Limiting Features documentation.

ccs-check

The /usr/local/cpanel/scripts/ccs-check script manages maintenance for the Calendar and Contacts Server (CCS) plugin. This script allows CCS to run with your server's SSL certificate. You can run this script after you install the CCS plugin on your server.

For more information, read our The ccs-check Script documentation.

check_cpanel_rpms

This script scans every installed RedHat® Package Manager (RPM) file on your server for problems.

For more information, read our The check_cpanel_rpms Script documentation.

check_security_advice_changes

This script returns the system's current security state. It will also provide information about how to resolve any security issues that it finds. You can configure this script to notify you when there is a change in the Security Advisor's state.

For more information, read our WHM Security Advisor interface (WHM >> Home >> Security Center >> Security Advisor) documentation.

check_users_my_cnf

This script checks cPanel accounts for malfunctioning ~/.my.cnf files and it disables them. This script only returns output when it detects a bad .my.cnf file.

For more information, run the following command:

/usr/local/cpanel/scripts/check_users_my_cnf --help
checkallsslcerts

This script installs or updates a cPanel-signed hostname certificate.

For more information, read our The checkallsslcerts Script documentation.

Note:

This script exists in the /usr/local/cpanel/bin directory.

chkmydnsThis script performs a simple configuration check of MyDNS.
cleansessions

This script removes various session files for the following applications:

  • phpMyAdmin
  • phpPgAdmin
  • Webmail applications

It also removes the following expired files:

  • cPanel Password Reset session and flood protect files.
  • cPanel Subaccount Invitation session and flood protect files.
clean_up_temp_wheel_users

This script removes temporary wheel group users that cPanel Support no longer requires.

Note:

When you use WHM's Grant cPanel Support Access (WHM >> Home >> Support >> Grant cPanel Support Access) and Create Support Ticket (WHM >> Home >> Support >> Create Support Ticket), the system will create temporary wheel users for cPanel Support.

clean_user_php_sessions

This script purges expired PHP session files from a secure temporary directory.

For more information, read our clean_user_php_sessions script documentation.

comparecdb

This script compares the contents of two CDB (Card DataBase format) files. Specify the two CDB files that you wish to compare.

For example, run the following command, where file1 and file2 represent the two files that you wish to compare:

/usr/local/cpanel/scripts/comparecdb file1 file2
configure_rh_ipv6_firewall_for_cpanel

This script sets up your IPv6 firewall.

Run this script if either of the following statements are true:

  • You do not manage your IPv6 firewall rules with any other tools or utilities.
  • You cannot connect to your IPv6 addresses or IPv6-enabled websites on port 80.

Notes:

  • Only users with root privileges can run this script.
  • The rules that this script creates remain active even if you reboot the server.
  • Due to the way in which CentOS 7, CloudLinux™ 7, and Red Hat® Enterprise Linux (RHEL) 7 manage firewalls, we do not recommend that you use this script if your server uses one of those operating systems. 

This script performs the following actions:

  • Opens port 22 for SSH.
  • Opens port 53 for DNS.
  • Opens port 80 for HTTP.
convert_accesshash_to_token

This script converts a WHM user's access hash to an API token.

For more information, read our The convert_accesshash_to_token Script documentation.

convert_mdbox_to_maildir

This script converts mailboxes from mdbox format to maildir format.

For more information, read our The Mailbox Format Conversion Scripts documentation.

convert_roundcube_mysql2sqlite

This script converts the Roundcube database from MySQL® to SQLite.

Warning:

You may need to convert individual accounts, even after the database conversion. To convert individual cPanel accounts that use Roundcube to SQLite, add the username as the parameter:

/usr/local/cpanel/scripts/convert_roundcube_mysql2sqlite user
copy-etc-filesThis script creates customized copies of your /etc/bashrc, /etc/issue, and /etc/issue.net files in the /etc directory.
cpanel_dovecot_solr_rebuild_index

This script script rebuilds your Apache Solr™ index files if they become corrupt. 

For more information, read our The cpanel_dovecot_solr_rebuild_index script documentation.

Note:

This script exists in the /usr/local/cpanel/3rdparty/scripts directory.

cpbackupThis script backs up all cPanel accounts.
cpdig

This script performs a DNS query with cPanel & WHM's DNS resolver. This script's result should equal the dig +trace command's end result.

For example, run the following command:

cpdig www.example.com AAAA

In this example, www.example.com is a domain and AAAA is a type of domain record.

cpuser_port_authority

This script assigns one or more 5-digit port numbers for a user's exclusive use.

For more information, read our The cpuser_port_authority script documentation.

dbmaptool

This script grants ownerships of databases and database users to a cPanel user via the command line.

For more information, read our The dbmaptool script documentation.

Note:

This script exists in the /usr/local/cpanel/bin directory.

dbstoregrants

This script synchronizes MySQL® user's grants for the YAML and JSON files in the /var/cpanel/databases/ directory through the command line.

For more information, read out The dbstoregrants Script documentation.

Note:

This script exists in the /usr/local/cpanel/bin directory.

delpopThis script removes a POP account.
dovecot_maintenance

This script deletes expired messages from trash folders. It also cleans out invalid usernames from the database tables.

Use the Trash Expire Time setting in WHM's Mailserver Configuration interface (WHM >> Home >> Service Configuration >> Mailserver Configuration) to set the expiration time. To activate this script, select the Auto Expunge Trash checkbox.

Note:

This script runs while the nightly maintenance script run.

dumpcdb

This script displays the contents of a CDB file. Specify the CDB file that you wish to view.

For example, run the following command, where file represents the file that you wish to view:

/usr/local/cpanel/scripts/dumpcdb file
email_hold_maintenance

This script removes the tracking file for email holds on mail to release or delete from the mail queue.

empty_user_trash

This script purges expired files from .trash folders in user home directories. Use the Age of content to purge from users' File Manager Trash setting in the System section of the WHM's Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings) to set the expiration time.

Notes:

  • This script runs while the nightly maintenance script runs.
  • This script exists in the /usr/local/cpanel/bin/ directory.
enable_spf_dkim_globally

This script enables SPF and DKIM for every cPanel user on the server. Then it creates SPF and DKIM records for all of these users' domains.

For more information, read our The SPF and DKIM Global Settings Script documentation.

eximstats_spam_check

This script scans the eximstats database and counts the number of emails that every domain on the server has sent in the previous hour. If a domain exceeds the preconfigured threshold of unique outbound messages (excluding mailing lists), the system will log an alert.

Use the following settings in the Mail section of WHM's Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings) to configure this script:

  • Number of unique recipients per hour to trigger potential spammer notification — Configure the threshold value of unique outbound messages.
  • Select the action for the system to take on an email account when it detects a potential spammer — Configure the script to take no action, hold, or reject additional outbound messages if the domain exceeds the threshold value
exportmydnsdbThis script exports zones from MyDNS for BIND and NSD to use.
find_and_fix_rpm_issues

This script detects issues with your server's RPM database and, if problems exist, rebuilds the database.

For more information, read our The find_and_fix_rpm_issues Script documentation.

find_outdated_services

This script checks all services to determine whether they require a restart. An outdated service is any service that depends on a library that is no longer present on the system.

For more information, read our The find_outdated_services Script documentation.

fix_addon_permissions

This script adjusts the permissions on cPAddon-specific files that contain sensitive information. This script only adjusts cPAddons that follow the tighter security model in cPanel & WHM version 64 and later

Note:

Some cPAddons possess security-sensitive files, such as files that contain passwords in clear text. cPAddons that exist on servers that do not use the mpm-itk, mod_ruid2, or mod_suphp modules require additional file permission adjustments to prevent security issues between users. For security reasons, we do not recommend that you install any cPAddons on shared hosting servers without one of these modules.

fixmailinglistpermsThis script repairs permissions for all mailing list files and directories.
fixndc

This script resolves ndc connection refused errors.

To correctly use this script, run the following commands:

/scripts/upcp
/scripts/fixndc
/scripts/fixndc

Important:

You must run the /scripts/fixndc script twice.

fix-web-vhost-configuration

This script scans each user’s web virtual host configuration files and removes excess alias names from the serveralias parameter.

For more information, read our The fix-web-vhost-configuration Script documentation.

gather-update-logs

This script sends update logs to cPanel, L.L.C. for analysis.

For more information, read our The gather-update-logs Script documentation.

hook

This script executes Standardized Hooks.

For more information, read our The hook Script documentation.

importmydnsdbThis script imports zone information into NSD from MyDNS or BIND.
install_cpaddons

This script manages the cPAddons' third-party software packages.

Notes:

  • This script runs while the nightly maintenance script runs.
  • This script exists in the /usr/local/cpanel/bin/ directory.
install_cpanel_analytics

This script installs the cPanel Analytics plugin.

For more information, read our cPanel Analytics documentation.

install_dovecot_fts

This script enables Internet Message Access Protocol (IMAP) Full-Text Search (FTS) Indexing (powered by Apache Solr™). This service provides fast search capabilities for IMAP mailboxes.

For more information, read our The install_dovecot_fts Script documentation.

install_plugin

This script installs a cPanel plugin.

For more information, read our Guide to cPanel Plugins documentation.

Important:

Due to the permissions that the /usr/local/cpanel/scripts/install_plugin script requires in order to access the necessary files, only the root user can run this script successfully.

installpostgresThis script installs PostgreSQL®.
installruby

This script installs Ruby.

Important:

We deprecated this script in cPanel & WHM version 66. 

is_script_stuck

This script checks how long a script's current PID has run. It can also notify a WHM user or kill the process.

For more information, read our The is_script_stuck Script documentation.

Note:

This script exists in the /usr/local/cpanel/bin directory.

maintenance

This script performs system updates. It also terminates the processes that you specify in WHM's Background Process Killer interface (WHM >> Home >> System Health >> Background Process Killer).

Note:

This script runs while the /usr/local/cpanel/scripts/upcp script runs.

manage_greylisting

This script manages the Greylisting service.

For more information, read our The manage_greylisting Script documentation.

manage_mysql_profiles

This script allows you to import and export MySQL profiles.

For more information, read our The manage_mysql_profiles Script documentation.

modsec_vendorThis script lists, adds, removes, or updates ModSecurity™ vendors.
modify_accounts

This script updates the theme for specific accounts on the server.

For more information, read our scripts/modify_accounts documentation.

modify_packages

This script updates the theme for specific packages on the server.

For more information, read our scripts/modify_packages documentation.

onboot_handler

This script runs any scripts that exist in the /var/cpanel/on_boot or /usr/local/cpanel/bin/on_boot directories.

Note:

The system runs scripts that exist in /var/cpanel/on_boot and /usr/local/cpanel/libexec/on_boot automatically when it reboots.

For more information, read our The onboot_handler Script documentation.

Note:

This script exists in the /usr/local/cpanel/bin/ directory.

php_fpm_config

This script installs configuration files when you manually edit the PHP-FPM configuration files.

For more information, read our The php_fpm_config Script documentation.

pkgacct

This script manages cPanel packages.

For more information, read our /scripts/pkgacct — Package a cPanel account documentation.

process_site_templatesThis script processes template files and user-provided data to create a Site Publisher website.
purge_modsec_logThis script removes stale records from the modsec database.
realperlinstaller

This script automates the installation of CPAN modules.

rebuild_dbmapThis script rebuilds a user's corrupted database map.
rebuild_phpconf

This script manages your server's default PHP version and PHP handlers in EasyApache 4.

For more information, read our The rebuild_phpconf Script documentation.

Note:

This script exists in the /usr/local/cpanel/bin/ directory.

rebuild_available_rpm_addons_cacheThis script rebuilds the available RPM-based cPAddons cache in the /var/cpanel/available_rpm_addons.cache file.
rebuild_whm_chrome

This script rebuilds the PHP cache of the WHM interface's chrome.

For more information, read our Guide to WHM Plugins documentation.

remove_dovecot_index_files

This script removes the Dovecot® index logs and cache files from cPanel email accounts.

For more information, read our The remove_dovecot_index_files Script documentation.

removeacctThis script removes a cPanel account.
rescan_user_dovecot_fts

This script performs a full text search (FTS) scan on an account's mailboxes.

For more information, read our The rescan_user_dovecot_fts Script documentation.

restartsrv_*

This group of scripts restarts services.

For more information, read our The restartsrv Scripts documentation.

restorepkg

This script restores a package.

For more information, read our The restorepkg Script documentation.

rpmup

This script updates system software for all users.

runstatsonceThis script updates all user statistics.
runweblogsThis script updates a user's statistics.
securemysql

This script secures a cPanel account's MySQL® configuration.

For more information, read our The securemysql Script documentation.

securetmp

This script hardens the /tmp partition in order to secure temporary files.

For more information, read our Tips to Make Your Server More Secure documentation.

server_queue

This script manages server queue tasks. cPanel & WHM's task queue system uses this script.

Note:

This script exists in the /usr/local/cpanel/bin directory.

For more information, read our servers_queue script documentation.

servicedomains

This scripts allows you to create service subdomain DNS records for a cPanel, WHM, or Webmail account from the command line.

For more information, read our The servicedomains Script documentation.

set_php_memory_limits

This script adjusts the memory_limit directive for all versions of PHP in the /opt/cpanel/ directory. It uses the server's available memory to determine an appropriate value.

For more information, read our MultiPHP INI Editor documentation. 

Note:

You must use the --run flag with this script.

set-tls-settings

This script manages a server's Secure Socket Layer (SSL) and Transport Layer Security (TLS) cipher suites and protocols. You can use this script to configure the following services:

  • Web Disk (cpdavd).
  • The cPanel & WHM server (cpsrvd).
  • Exim (exim).
  • The Dovecot mail server (dovecot).

Note:

This script exists in the /usr/local/cpanel/bin directory.

For more information, read our The set-tls-settings Script documentation.

setupftpserver

This script allows you to perform the following actions:

  • Select an FTP server.
  • Configure anonymous FTP services.
  • Disable FTP services.

For more information, read our The setupftpserver script documentation.

setup_greylist_dbThis script creates the greylist SQLite database. It also allows you to add common email services to the trusted hosts list.
setup_modsec_dbThis script creates the modsec MySQL database and user.
setupmailserver

This script allows you to switch between mail servers.

Important:

We removed the Courier mail server in cPanel & WHM version 54. cPanel & WHM only ships with the Dovecot mail server.

setupnameserver

This script allows you to switch between DNS servers.

Warning:

We deprecated the MyDNS and NSD nameservers in cPanel & WHM version 78. We plan to remove them in a future release. We strongly recommend that you only switch between the PowerDNS and BIND nameservers.

slurp_exim_mainlog

This script imports all unarchived Exim exim_mainlog data in the /var/log/ directory into the eximstats database. It will only import files newer than Exim's log retention setting. The default setting for Exim's log retention period is 90 days.

Note:

  • This script will ignore files that do not have the .gz file extension.
  • The system only allows log imports once every seven days. You can use the --force option to run the script regardless of the seven day waiting period.
  • When you rebuild the eximstats database, you can use the --reimport option to import exim_mainlog data.
spf_installer

This script adds SPF records to all of a user's domains' zone files from the command line.

For more information, read our The spf_installer Script documentation.

Note:

This script exists in the /usr/local/cpanel/bin directory.

suspendacctThis script suspends an account.
swapip

This script allows you to specify parameters from the command line in order to update DNS records.

For more information, read our The swapip Script documentation.

Note:

This script exists in the /usr/local/cpanel/bin directory.

sync-mysql-users-from-grants

This script creates default MySQL or MariaDB users for any cPanel users that require them.

Note:

When you enable MySQL or MariaDB, the system automatically performs this function. In most cases, you do not need to run this script.

try-later

This script executes a user-defined check command at a specified interval. If the check command returns an error, it retries as often as the max-retries parameter allows. When the check succeeds, a user-defined action command runs.

You can use this script with the following options:

--at

When you add this option to the try-later script, it specifies a delay (in an interval other than minutes) after which to run the check and action commands. If you set this option, then the try-later command will pass directly to the at command.

For more information about the at command, visit its man page.

--action

When you add this option to the try-later script, it runs when the check command succeeds.

--act-finally

When you add this option to the try-later script, it runs the action command after the system uses the maximum number of retries.

--check

When you add this option to the try-later script, it determines whether the action command will run.

--delay

When you add this option to the try-later script, it delays the check and action commands.

This value defaults to 5 minutes. If you set this option, then it overrides the --at option.

--help

When you add this option to the try-later script, it displays a brief help message.

--max-retries

When you add this option to the try-later script, it specifies the maximum number of retry attempts before you run the action command.

This value defaults to unlimited.

--skip-first

When you add this option to the try-later script, it skips the initial check command.
uninstall_cpanel_analytics

This script uninstalls the cPanel Analytics plugin.

For more information, read our cPanel Analytics documentation.

uninstall_plugin

This script uninstalls a cPanel plugin.

For more information, read our Uninstall Plugins documentation.

unlink_service_account

This script restores a service account to an unlinked state.

unsuspendacctThis script unsuspends an account.
*up

This group of scripts updates services.

We currently provide update scripts for the following services (replace the asterisk (*) in *up with the desired item below):

cpaddonsup

This script updates the cPAddons scripts.

upcp

This script updates cPanel & WHM.

upcp-running

This script determines whether a upcp script is currently running.

For more information, read our The upcp-running Script documentation.

upgrade_subaccount_databases

This script verifies and upgrades the Subaccount database table schemas for each cPanel account.

view_transfer

You can use this script to monitor transfer sessions.

For more information, read our The view_transfer Script documentation.

Note:

This script exists in the /usr/local/cpanel/bin directory.

vps_optimizer

This script optimizes the Maximum Children settings for Apache SpamAssassin™ for the amount of memory on your server.

For more information on the Maximum Children setting, read our Spamd Startup Configuration documentation.

whmloginThis script generates a single-use session login URL for WHM.
wwwacct

This script creates a cPanel account.

For more information, read our The wwwacct Script documentation

Additional documentation