CPanel Scripts: Difference between revisions
No edit summary |
No edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
<code>/scripts/upcp --force</code> - Updates cPanel (use with caution) | <code>/scripts/upcp --force</code> - Updates cPanel (use with caution) | ||
<code>/ | <code>/scripts/clear_orphaned_virtfs_mounts --clearall</code> - Cleans the virtfs folders for users who no longer exist or who no longer use a jailed shell environment. | ||
<code>/scripts/fixquotas –force</code> - Rebuilds disk quotas (helpful when something is showing incorrect usage.) | |||
<code>/scripts/updatenameserverips</code> - Forces the nameserver record report to run. | |||
<code>/ | <code>/scripts/autorepair mysql_gpg_key</code> - Fixes MySQL 5.7 GPG errors in yum | ||
<code>/ | |||
'''Auto-SSL:'''<br /> | |||
<code>/usr/local/cpanel/bin/checkallsslcerts</code> - Checks All service SSL certificates. | |||
<code>/usr/local/cpanel/bin/autossl_check --user=$usernamehere</code> - force Auto-SSL to check a specific account | |||
<code>/usr/local/cpanel/bin/autossl_check_cpstore_queue --force</code> - forces Auto-SSL to check the queue at the cPanel store. | |||
Line 26: | Line 36: | ||
'''Mail | <code>/scripts/backups_clean_metadata_for_missing_backups</code> - Clean backup metadata. Run this after manually deleting a backup from /backup | ||
<code>/scripts/generate_maildirsize --confirm --allaccounts --verbose $USER</code> | |||
'''Mail Scripts''' :<br /> | |||
<code>/scripts/generate_maildirsize --confirm --allaccounts --verbose $USER</code> - fix mail sizes showing incorrectly | |||
<code>/scripts/mailperm</code> - fix mail permissions on cPanel | |||
<code> /usr/local/cpanel/scripts/remove_dovecot_index_files --user username --all --verbose </code> - rebuild dovecot indexes | |||
'''Check RPMs''' and possibly re-install:<br /> | '''Check RPMs''' and possibly re-install:<br /> | ||
<code>/scripts/check_cpanel_rpms</code> | <code>/scripts/check_cpanel_rpms</code> | ||
or:<br /> | |||
<code>/scripts/check_cpanel_pkgs</code> | |||
'''Re-Build Dovecot indexes''' :<br /> | |||
<code>/usr/local/cpanel/scripts/remove_dovecot_index_files --user $cPanel_user --all --verbose</code> | |||
Line 37: | Line 62: | ||
Weird database permission/authentication issues? Try restoring the database grants:<br /> | Weird database permission/authentication issues? Try restoring the database grants:<br /> | ||
<code>/usr/local/cpanel/bin/restoregrants --cpuser=$cpuser --db=mysql --all</code> | <code>/usr/local/cpanel/bin/restoregrants --cpuser=$cpuser --db=mysql --all</code> | ||
'''Domains Not Showing Properly'''<br /> | |||
<code>/scripts/updateuserdomains</code> | |||
<code>/scripts/updateuserdatacache</code> |
Latest revision as of 21:57, 7 February 2022
cPanel has a bunch of scripts in the /scripts
folder.
For most of them, you can run: /scripts/script_name_here --help
to see what the script does. (Except for upcp... --help is not available for it.)
Scripts
/scripts/whowns domain.com
- Tells you which cPanel account owns the specified domain.
/scripts/upcp --force
- Updates cPanel (use with caution)
/scripts/clear_orphaned_virtfs_mounts --clearall
- Cleans the virtfs folders for users who no longer exist or who no longer use a jailed shell environment.
/scripts/fixquotas –force
- Rebuilds disk quotas (helpful when something is showing incorrect usage.)
/scripts/updatenameserverips
- Forces the nameserver record report to run.
/scripts/autorepair mysql_gpg_key
- Fixes MySQL 5.7 GPG errors in yum
Auto-SSL:
/usr/local/cpanel/bin/checkallsslcerts
- Checks All service SSL certificates.
/usr/local/cpanel/bin/autossl_check --user=$usernamehere
- force Auto-SSL to check a specific account
/usr/local/cpanel/bin/autossl_check_cpstore_queue --force
- forces Auto-SSL to check the queue at the cPanel store.
Backup:
/usr/local/cpanel/bin/backup --force
- force a manual backup
/usr/local/cpanel/scripts/cpbackup
- run a legacy backup
/scripts/pkgacct user
- backs up the entire specified cPanel account, including databases, e-mail, settings, etc. Replace "user" with the cPanel username to backup.
/scripts/backups_clean_metadata_for_missing_backups
- Clean backup metadata. Run this after manually deleting a backup from /backup
Mail Scripts :
/scripts/generate_maildirsize --confirm --allaccounts --verbose $USER
- fix mail sizes showing incorrectly
/scripts/mailperm
- fix mail permissions on cPanel
/usr/local/cpanel/scripts/remove_dovecot_index_files --user username --all --verbose
- rebuild dovecot indexes
Check RPMs and possibly re-install:
/scripts/check_cpanel_rpms
or:
/scripts/check_cpanel_pkgs
Re-Build Dovecot indexes :
/usr/local/cpanel/scripts/remove_dovecot_index_files --user $cPanel_user --all --verbose
Database Grants
Weird database permission/authentication issues? Try restoring the database grants:
/usr/local/cpanel/bin/restoregrants --cpuser=$cpuser --db=mysql --all
Domains Not Showing Properly
/scripts/updateuserdomains
/scripts/updateuserdatacache