userlogs.sh

It sometimes happens when a user on a directadmin server causes heavy load. When this user only has 1 domain it’s easy to figure out what’s going on. But sometimes there are users with a lot more domains. This script makes it easier to tail all of the sites’ acces logs in one go.

#!/bin/bash

##################################################################
# userlogs.sh v1.0                                               #
# tails the acces logs of all the domains of a given user. Makes #
# it a lot easier when 1 user is causing heavy load.             #
# (c)opyleft Take13                                              #
##################################################################

if [ -z "$1" ]
then
        echo "Usage: "$0 "username"
        exit;
fi

cd /home/$1/domains
tail -f `ls -1 | awk '{print "/var/log/httpd/domains/"$1".log"}'`

Comments

Leave a Reply

Your email address will not be published.

sixteen + 3 =