Scripts and stuff

Loading...

Skip to content
Scripts and stuff
Tel: 123-456-789
  • RSS
  • Home
  • Shell scripts
  • Uncategorised
  • About this site
  • Privacy Policy

userlogs.sh

Posted on 01/06/2022Updated on 01/06/2022by Invader ZimCategories:Shell scripts

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"}'`

Invader Zim

take13.net

Comments

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

16 + nine =

Tel: 123-456-789
  • RSS
© Scripts and stuff. All rights reserved.
Back to top