WHM allows you to configure cron jobs intervals for the upcp, backup and cpbackup scripts.
To access the WHM Cron Jobs interface:
Access your WHM installation
Navigate to Server Configuration >> Configure cPanel Cron Jobs
Set the cron jobs intervals setting (Minute, Hour, Day, Month, Weekday) and click the Save button. You will see a confirmation message: Success: Your cron entry for “upcp/backup/cpbackup” has been successfully saved.
cPanel provides some info for cron jobs:
Minute: The number of minutes between each execution of the cron job, or the minute of each hour on which you wish to run the cron job. For example, 15 to run the cron job every 15 minutes.
Hour: The number of hours between each execution of the cron job, or the hour each day (in military format) at which you wish to run the cron job. For example, 2100 to run the cron job at 9:00pm.
Day: The number of days between each execution of the cron job, or the day of the month on which you wish to run the cron job. For example, 15 to run the cron job on the 15th of the month.
Month: The number of months between each execution of the cron job, or the month of the year in which you wish to run the cron job. For example, 7 to run the cron job in July.
Weekday: The day(s) of the week on which you wish to run the cron job.
The first thing you will want to do after installing cPanel/WHM is to go to the Basic WebHost Manager Setup menu. Here you can configure basic things like:
contact options: contact email address, ICQ contact number, HipChat Room users to notify, Pushbullet API
the server IP address options: IPv4/IPv6 addresses (only one address for each) to use to set up shared IPv4/IPv6 virtual hosts, location where new user home directories will be created, default cPanel interface package, if you want to automatically create a cgi-bin script alias for users, style for the Apache logs (combined or common)
default nameservers you want to use and their IP addresses (from the interface you can configure up to 4 nameservers)
To access the Basic WebHost Manager Setup menu, follow the steps:
Log in to WHM.
Go to Server Configuration >> Basic WebHost Manager Setup
Here modify the options you want and in the end, click the Save Changes button.
Many times web hosting admins prefer to use the shell for file operations, but for beginners, this is a great tool. You can create/rename/delete/move both files and directories. You can also search the server for specific files.
This will create a backup with all MySQL/MariaDB databases on the server. The filename will include the current date. (e.g. 2018-Sep-25-alldatabases.sql.gz) You can modify the command per your needs. You can also create a cron job to run it at specific times.
Another possibility is to backup each database on the server individually. For this create a new file like backupdbs.sh The content of the file is:
mkdir -p $backupdir/$date
databases=`$mysql -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema)"`
for db in $databases; do
$mysqldump --opt --databases $db | gzip > "$backupdir/$date/$db.sql.gz"
To run the script:
root@www [/backup]# perl backupdbs.sh
As in the previous case, you can also adjust the script per your needs and create a cron job.
Many times while troubleshooting clients’ mail issues you will need to find out the forwarders/autoresponders they have.
On a cPanel server, this information is kept in separate files for each domain(and subdomain) in the /etc/valiases/ directory – like /etc/valiases/domain123.com; /etc/valiases/homedomain.net etc.
After root login, look for the interested domain as:
root@www [~]# cd /etc/valiases/
root@www [/etc/valiases]# cat phdomain123.com
firstname.lastname@example.org: "|/usr/local/cpanel/bin/autorespond email@example.com /home/phdomain123/.autorespond"
*: ":fail: No such person at this address"
In our example:
– the first line is a forwarder to a file (a PHP script)
– the second line is an autoresponder for the email firstname.lastname@example.org
– the third line is a forwarder to an email address
– the fourth line is the default action for unrouted emails. In this case, the “No such person at this address” message will be sent back.
If you don’t like the command line, you can use a plugin for WHM called ConfigServer Mail Manage. After installation, access it from WHM->Plugins->ConfigServer Mail Manage; choose the domain from the list and click the Manage Mail Forwarders button. You will see something like:
You can also check forwarders/autoresponders by accessing the client’s cPanel account.