Page tree
Skip to end of metadata
Go to start of metadata

For cPanel & WHM version 60

Overview

When cPanel & WHM installs, cPanel-provided scripts become available in 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 

Warning:

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
addpopAdds a POP account.
build_maxemails_configSets limits on the amount of email that users can send from domains on your server. For more information about this script's limits, read our Mail Limiting Features documentation.
check_users_my_cnf

Checks user accounts for ~/.my.cnf files that do not work, and disable them. This script only returns output when it detects a bad .my.cnf file.

Note:

For more information, run the following command:

/usr/local/cpanel/scripts/check_users_my_cnf --help
chkmydnsPerforms a simple configuration check of MyDNS.
cleansessions

Removes various session files for the following applications:

  • phpMyAdmin
  • phpPgAdmin
  • Horde
  • RoundCube
  • SquirrelMail

Removes the following expired files:

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

Note:

For more information, run the following command:

/usr/local/cpanel/scripts/cleansessions --help

comparecdb

Compares the contents of two CDB files. Specify the two CDB files that you wish to compare after the script.

Note:

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

Sets up your IPv6 firewall. Any user with root privileges can run this script. 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:

  • 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_maildir_to_mdbox

Converts mailboxes from maildir format to mdbox format. For more information, read our The Mailbox Format Conversion Scripts documentation.

convert_mdbox_to_maildir

Converts mailboxes from mdbox format to maildir format. For more information, read our The Mailbox Format Conversion Scripts documentation.
convert_roundcube_mysql2sqlite

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-filesCreates customized copies of your /etc/bashrc, /etc/issue, and /etc/issue.net files in the /etc directory.
cpbackupBacks up all accounts.
delpopRemoves a POP account.
dovecot_maintenance

Runs nightly and deletes messages from trash folders that are older than the Trash Expire Time value in WHM's Mailserver Configuration interface (Home >> Service Configuration >> Mailserver Configuration). To activate this script, select the Auto Expunge Trash checkbox.

It also cleans out invalid usernames from the database tables.

dumpcdb

Displays the contents of a CDB file. Specify the CDB file that you wish to view.

Note:

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

/usr/local/cpanel/scripts/dumpcdb file
easyapacheUpgrades and reinstalls Apache.
empty_user_trash

Purges files from .trash folders in user home directories that are older than the Age of content to purge from users' File Manager Trash setting in the System section of the WHM's Tweak Settings interface (Home >> Server Configuration >> Tweak Settings).

Notes:

  • This script runs as a part of the nightly maintenance script.
  • This script exists in the /usr/local/cpanel/bin/ directory.
exportmydnsdbExports zones from MyDNS for use with BIND and NSD.
fixmailinglistpermsRepairs permissions for all mailing list files and directories.
gather-update-logsSends update logs to cPanel, Inc. for analysis.
hookExecutes any hooks that the system would normally call in the specified context.
importmydnsdbImports zone information from BIND and NSD into MyDNS.
installpostgresInstalls PostgreSQL®.
install_plugin

Installs a cPanel plugin. For more information, read the 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.

installrubyInstalls Ruby.
maintenance

Performs system updates, and terminates the processes that you specify in WHM's Background Process Killer interface (Home >> System Health >> Background Process Killer).

Note:

This script runs as a part of the /scripts/upcp script.

manage_greylistingManages the cPanel Greylisting service. For more information, read The manage_greylisting Script documentation.
modsec_vendorLists, adds, removes, or updates ModSecurity™ vendors.
modify_accounts

Updates the theme for specific accounts on the server.

Note:

For more information, read the scripts/modify_accounts  documentation or run the following command: 

/usr/local/cpanel/scripts/modify_accounts --help
modify_packages

Updates the theme for specific packages located on the server.

Note:

For more information, read the scripts/modify_packages documentation or run the following command: 

/usr/local/cpanel/scripts/modify_packages --help
phpextensionmgrManages PHP extensions.
pkgacctHandles cPanel packages. For more information, read our /scripts/pkgacct — Package a cPanel account documentation.
process_site_templatesProcesses template files and user-provided data to create an Site Publisher website.
purge_modsec_logRemoves stale records from the modsec database.
realperlinstaller

Automates the installation of CPAN modules.

rebuild_dbmapRebuilds a user's corrupted database map.
rebuild_phpconf

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.

restartsrv_*

Restarts a service. For more information, read our How to Restart Services documentation.

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

apache

Restarts the Apache web server.

bind

Restarts the BIND nameserver software.

chkservd

Restarts cPanel’s TailWatch log processing service.

clamd

Restarts the ClamAV antivirus software.

cpanellogd

Restarts the cpanellogd daemon.

cpdavd

Restarts cPanel’s WebDAV server.

cphulkd

Restarts cPHulk.

cpipv6

Binds or rebinds the server's IPv6 addresses. Run this script with the --list flag to list all of the server's bound IPv6 addresses.

cpsrvd

Restarts the cpsrvd daemon.

crond

Restarts the crond daemon.

dnsadmin

Restarts the dnsadmin daemon.

dovecot

Restarts the Dovecot mail server.

exim

Restarts the Exim mail exchanger.

eximstats

Restarts the Exim mail statistics tracker.

ftpd or ftpserver

Restarts the configured FTP service (ProFTPd or Pure-FTPd).

httpd

Restarts the Apache web server.

imap

Restarts the IMAP server (Dovecot).

inetd

Restarts the super-server daemon that manages Internet services.

ipaliases

Restarts the IP address aliasing software.

mailman

Restarts Mailman.

mydns

Restarts the MyDNS server.

mysql

Restarts the MySQL database server.

named

Restarts the BIND nameserver software.

nsd

Restarts the NSD nameserver daemon.

p0f

Restarts the passive OS fingerprinting service.

postgres or postgresql

Restarts the PostgreSQL database service.

proftpd

Restarts the ProFTPd server daemon.

pureftpd

Restarts the Pure-FTPd server daemon.

queueprocd

Restarts the queueprocd daemon.

rsyslogd

Restarts the open-source log forwarder daemon.

spamd

Restarts the Apache SpamAssassin™ daemon.

sshd

Restarts the Secure shell daemon.

syslogd

Restarts the Log forwarder daemon.

tailwatchd

Restarts cPanel’s TailWatch log processing service.

tomcat

Restarts the Apache Tomcat service.

xinetd

Restarts the open-source super-server daemon.

removeacctRemoves a cPanel account.
restorepkgRestores a package. For more information, read our The restorepkg Script documentation.
rpmupUpdates system software for all users.
runstatsonceUpdates statistics for all users.
runweblogsUpdates statistics for a user.
setupftpserverAllows you to switch between FTP servers.
setup_greylist_dbCreates the greylist SQLite database and allows you to add common email services to the trusted host list.
setupmailserver

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.

setup_modsec_dbCreates the modsec MySQL database and user.
setupnameserverAllows you to switch between DNS servers.
slurp_exim_mainlogImports exim mainlog data into the eximstats database.
suspendacctSuspends an account.
try-laterExecutes 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

Allows you to specify 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. To learn more about the at command, visit its man page.

--action

Runs when the check command succeeds.

--act-finally

Runs the action command when retries are exhausted.

--check

Determines whether the action command will run.

--delay

Allows you to specify a delay (in minutes) after which to run the check and action commands. This value defaults to 5. If you set this option, then it overrides the --at option.

--help

Displays a brief help message.

--max-retries

Allows you to specify the maximum number of retry attempts before you run the action command. This value defaults to unlimited.

--skip-first

Skips the initial check command.
uninstall_pluginUninstalls a cPanel plugin. For more information, read our Uninstall Plugins documentation.
unlink_service_account

Restores a service account to an unlinked state.

Note:

For more information, run the following command:

/scripts/unlink_service_account --help

unsuspendacctUnsuspends an account.
*upUpdates a service. We currently provide several scripts that use this format to update a service.

cpaddonsup

Updates the cPAddons scripts.

phpup

Updates the current version of PHP.

suphpup

Updates the suPHP tool to handle PHP requests.
upcp
Updates cPanel & WHM.
upcp-runningSpecifies whether a upcp command runs. This information displays in text output and the script's exit value. By default, a zero exit value signals that the target upcp command currently runs.

--help

Displays a brief help message.

--invert-exit

Exits with a non-zero error value (1) if the target upcp command currently runs.
upgrade_subaccount_databases

Verifies and upgrades the Subaccount database table schemas for each cPanel account.

Note:

For more information, run the following command:

/usr/local/cpanel/scripts/upgrade_subaccount_databases --help
wwwacctAdds a cPanel account. For more information, read our The wwwacct Script documentation

Additional documentation

There is no content with the specified labels

There is no content with the specified labels

There is no content with the specified labels