cPanel Config

Welcome to cPanelConfig the fastest growing cPanel configuration and troubleshooting guide on the internet. Please take the time and register. We would love to have your contribution to this completely free cPanel resource. We are updating this daily so be sure to visit us on a regular basis.

Backup partition table and bootloader

Posted by yolau

In this article I will be explaining how to backup the MBR record of a hard-drive.
The MBR record contains the partition table and bootloader.

Having a backup of the MBR is useful in case you want to copy data from an older drive to a new one or in case you want to restore data from [...]

Using the screen command

Posted by yolau

What is the screen command?

First of all I will start by telling you what you can do using the “screen” command.
Many times as a linux sysadmin you will need to run multiple commands at once. You are probably doing this by opening multiple ssh sessions but there is a better way to do it !
Also [...]

mysql execute query from console and export to csv

Posted by copilas12

Hello. To dump a query to csv use this:

mysql  –database=database –execute=”select a from b where a>1;” | sed ’s/\t/”,”/g;s/^/”/;s/$/”/;s/\n//g’ > filename.csv
If you enjoyed this post, make sure you subscribe to my RSS feed!

exim commands

Posted by copilas12

Hello. I want to share some helpful exim commands for large mailservers:
1. froze messages to recipient root@host.localhost.com

/usr/sbin/exiqgrep -i -r root@host.localhost.com | /usr/bin/xargs exim -Mf
2. delete frozen messages
/usr/sbin/exiqgrep -z -i | /usr/bin/xargs exim -Mrm
3. delete messages older than X hours (X in seconds)
/usr/sbin/exiqgrep -o X -i | /usr/bin/xargs exim -Mrm
4. total messages in queue
/usr/sbin/exiqgrep | /usr/sbin/exiqsumm [...]

mysqldump without locking tables

Posted by copilas12

Hello. I had a trouble some time ago: i wanted to dump a large table (38 million rows, 5G size) without locking the table because the website can’t go down. So, here is the mysqldump command:

mysqldump –skip-add-locks –skip-lock-tables database > database.sql
or for just a table:
mysqldump –skip-add-locks –skip-lock-tables database table > database.table.sql

Hope this help.
If you enjoyed [...]

Cpanel /scripts folder with explanation of every script.

Posted by copilas12

Hello. I found this browsing. I think it will be helpful to post it in here.

Here it is:
adddns - Adds a DNS zone.
addfpmail - Add frontpage mail extensions to all domains without them.
addfpmail2 -Add frontpage mail extensions to all domains without them.
addnetmaskips - Add the netmask 255.255.255.0 to all IPs that have no netmask.
addnobodygrp - [...]