Mail Queue Management Exim

Managing emails can be cumbersome when you need to look into several things such as removing spam mails, Frozen mails, Bounce mails, Queue force rerun, among others.

Now, from our experience, we are sharing some commonly used commands below for managing Exim Servers:

To get the total number of mails in the queue

# exim -bpc

To list the mails in the queue

# exim -bp

Used to remove the message from queue with Exim Id : 1VcjOL-0002YV-8g

# exim -Mrm 1VcjOL-0002YV-8g

Read more

mysqli_connect(): (HY000/2002): Can’t connect to local MySQL server through socket – SugarCRM – cron.php

PHP Warning: mysqli_connect(): (HY000/2002): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in sugarcrm/include/database/MysqliManager.php on line We have faced such an error with SugarCRM today. The above error was reporting in error_log file every time the cron.php is executed via cron job. We have taken a closer look and couldn’t find any real reason why … Read more

Remove old backups from rdiff-backup backup point – rdiff backup remove old increments

Remove old backups from rdiff
Importance of Backups in Hosting Industry

In the hosting industry, sudden failure of a hard disk can cause sleepless nights for server owners and can cause a bad reputation company as well. Also having proper remote backups is an added advantage to the customers as well and can attract some customers as well due to this. Rdiff-backup is one such tool which is having great features that every hosting owner will wish to have. 

What is Rdiff-backup

Rdiff-backup is a powerful remote backup tool that is based on python.

Rdiff-backup backs up one directory to another possibly over the network. The target directory will have a copy of the source directory but extra reverse diffs of that directory are stored in a subdirectory which will help us to recover files from long ago. In this tool, they have combined the features of mirroring and incremental backups. 

Rdiff-backup preserves subdirectories, hard links, uid/gid ownership (provided this is running as root), resource forks, modification times, permissions, etc which makes this a perfect tool for backups 

In this blog, we mainly discuss only the removal of old backups. 

How to remove old backups from rdiff-backup properly 

To remove old backups from rdiff-backup ( so-called increments ), you can use “–remove-older-than” option of rdiff-backup command. You should have to specify the “time from which” value as well along with that switch. The rdiff-backup tool provides the flexibility to define that time_spec value in years, months, weeks, days, hours, minutes, and seconds. Each representation is given below.

To Remove backups older than one year, use the below 

–remove-older-than 1Y 

To Remove backups older than one month, use the below 

–remove-older-than 1M 

To Remove backups older than one week, use the below 

–remove-older-than 1W

To Remove backups older than one hour, use the below 

–remove-older-than 1h 

To Remove backups older than one minute, use the below 

–remove-older-than 1m 

To Remove backups older than one second, use the below 

–remove-older-than 1s 

The entire command to remove backups ( increments ) should look like following

Read more

Linux Shell Scripting – An Introduction

Linux Shell Scripting

Scripts are collections of commands that are stored in a file. The shell can read this file and act on the commands as if they were typed at the keyboard. The shell also provides a variety of useful programming features to make your scripts truly powerful.

Write a simple shell script

Use an editor software to write the script. The following is the simplest “Hello World” program.

#!/bin/sh
# My first script
echo "Hello World!"

and save the above script to the file name “myScript.sh”

We can use any name for saving the script. but here I am using “.sh” extension for my script, since the shell used here is “/bin/sh”. Also it will help us to identify the scripts from a other files and folders.

Read more

Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp

The other day we faced an issue with the memory and the exact error was can be described as below:

[Mon Sep 30 10:00:29 2013] [error] [client 117.196.128.34] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/unier/public_html/index.php
[Mon Sep 30 10:00:29 2013] [error] [client 117.196.128.34] File does not exist: /home/unier/public_html/500.shtml

On the first look, we should check the Apache conf for any memory limits set  in the Apache configuration file.  You can check this using the below command

# grep RLimitMEM /usr/local/apache/conf/httpd.conf

If you are seeing any result like the below one,  try disabling or removing the line in the httpd.conf file, and restarting Apache.

Read more

Cannot start Postfix – Postfix integrity check failed Error

Here is what you can do when you are unable to start Postfix and you are getting Postfix integrity check failed Error. 
Here is the scenario:
 

Postfix was not running and an attempt to restart Postfix was failing with the following error in maillog.

mail postfix/postfix-script: fatal: Postfix integrity check failed!
mail postfix/postfix-script: fatal: the Postfix mail system is not running

We have tried several number of solutions and after a bit of research, we found the following command works and running that resolved the issue.

Read more

Disable unwanted services – Linux Server

One of the first steps that we should do while presetting a server is to disable unwanted services on the server. The server should be preloaded with some services like bluetooth, X services, etc which are not required to a server normally. The number of such services will vary, based on the default packages installed by your provider. After a little research, we have compiled in a list of services that can be disabled on  Linux servers. Please note that this is a generic one and you should check the list before implementing it, if you are going to build any custom stuff. Normally it should work seamlessly with control panel installations, web services , etc.

The list of services that can be disbaled are listed below seprately for VPS and dedicated servers.

Read more