CXS is a paid scanner which is more compatible with cPanel servers. The following script is to scan the server using CXS and will send the scan report to your email address.

=====

#!/bin/bash

DATE=$(date +%F_%H:%M)

REPORT=/root/cxs-{DATE}.txt

HOST=$(hostname)

CXS=$(which cxs)

EMAIL_ID=”youremail@domain.tld”

$CXS –allusers –generate –report $REPORT

if [ -s $REPORT ] ; then

cat $REPORT | mail -s “CXS Monthly Scan Report – $HOST” $EMAIL_ID

fi

=====

You can add this script to your cron according to your requirement. But, please note that the scan will utilise lot of resource so it would be better to configure the cron in a weekly or monthly during the off-peak hours.

 

 

Leave a Reply