Custom Usage Report creation

rotame

Verified User
Joined
Jul 4, 2019
Messages
50
Hi,

I want to make a report for
User , Contact Email, domain(s), Package, Reseller

How can do that ?

Which command to execute ?

BR
Antonis
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,853
Location
GMT +7.00
Hello Antonis,

All the requested information is stored in text files: /usr/local/directadmin/data/users/*/user.conf

So you will need to do a loop and collect all needed data and format it. Something like this:

Code:
for USER in $(cat /usr/local/directadmin/data/users/*/users.list | sort | uniq); do \
echo "${USER};$(grep ^email= /usr/local/directadmin/data/users/${USER}/user.conf | cut -d= -f2);\
$(cat /usr/local/directadmin/data/users/${USER}/domains.list | xargs);\
$(grep ^package= /usr/local/directadmin/data/users/${USER}/user.conf | cut -d= -f2);\
$(grep ^creator= /usr/local/directadmin/data/users/${USER}/user.conf | cut -d= -f2);"; \
done;
 
Top