After a WHM/cPanel installation, you may want to change the server time. Of course, you can do this from the command line, but you can also do this via the WHM interface.
To change your dedicated/virtual server time via the WHM interface:
Connect to your WHM installation
Go to Server Configuration >> Server Time.
Now select the time from the drop-down list box and click the Change TimeZone button to apply it. You will see a confirmation message like Local timezone has been set to America/New_York.
Restart the server via System Reboot >> Graceful Server Reboot
cPanel recommend you to restart the server after each time zone modification: To ensure consistency, we strongly recommend that you reboot the server after you change the time zone.
There is also a button to sync the server time. Use this to sync the time with the time server. Notice that this will not work on virtual servers – you will get a warning message Container environment detected – rdate skipped.
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.