Cron jobs are added separately for each user through the cPanel and WHM web interface, namely cPanel “Advanced” -> “Cron Jobs“.
Through the WHM panel “Home” -> “Server Configuration” -> “Configure cPanel Cron Jobs“.
But there are also system tasks that can not be seen through the panel.
They can be seen by connecting through SSH to the server and running the command from the root user:
or from another user via sudo:
sudo crontab -e
In the nano editor, the shortcut Ctrl+X is used to exit, and y/n to save or discard the changes.
The file itself with the tasks is located on the path /var/spool/cron/root
If an annoying report is sent to an e-mail when executing an assignment, you can hide the output of the task by adding the following code to the end of the command:
To restart the Cron service, use the command:
service crond restart
See also a similar article: Using and configuring CRON
Here is an example of checking the public_html directory with the removal of infected files:
/usr/local/cpanel/3rdparty/bin/clamscan -ri --remove /home/user/public_html
Similarly, other directories are checked.
To start checking only the mail and public_html directory for all users:
/usr/local/cpanel/3rdparty/bin/clamscan -ri /home/*/mail
/usr/local/cpanel/3rdparty/bin/clamscan -ri /home/*/public_html
To update the anti-virus database, use the command:
See also my article:
Installing and using ClamAV antivirus software
Below is a list of paths for cPanel log files.
Continue reading “Location of log files cPanel”
The services must be restarted through the WHM interface, by opening “Home” > “Restart Services”.
If the restart of the service through the WHM interface failed, then the script should be used:
If you are using IPv6 and the command was executed:
service network restart
That IPv6 does not work to solve the problem:
/etc/init.d/cpipv6 restart (for cPanel & WHM version 11.52 and earlier)
/usr/local/cpanel/scripts/restartsrv_cpipv6 (for cPanel & WHM version 54 and later)
In extreme cases, you can try to restart the service directly:
systemctl restart service-name.service
Location of log files cPanel
I will list and describe the standard paths to the cPanel & WHM configuration files:
Continue reading “Location of configuration files cPanel & WHM”
I noticed some errors coming to the root mail with the subject and the text:
Cron /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.
The problem lies in the file ~ / .my.cnf, that is /root/.my.cnf in my case.
In which the parameter “pass” is obsolete and must be changed to a new “password”.
For example, that’s how it was when the error occurred:
Changed to password and the error disappeared:
Connecting to MySQL from localhost without entering a password
cPanel allows you to use several web interfaces at once for viewing mail, sometimes they can be disabled or perhaps some of them need to be disabled.
Continue reading “How to enable Horde, SquirrelMail and RoundCube in cPanel”
Suppose you want all mail that arrives at nonexistent mailboxes in your domain to be delivered to a specific mailbox.
1) On the cPanel main page, in the “Email” section, select “Default Address ”
2) In the window that opens, select the domain (if there are several), select “Forward to Email Address” and specify which address to forward.
Instead of sending it, you can also choose to delete emails, forward to a system mail account, or send to a script.