I need to rebuild all of my Resellers' users.list files

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » DirectAdmin

I need to rebuild all of my Resellers' users.list filesLast Modified: Jan 1, 2012, 3:46 pm
If your users.list files for all of your Resellers/Admins becomes corrupt, you can create and run this script to rebuild them all.
Corruption can happen during any process that writes the users.list file if multiple processes are saving the file at the same time (locking issue).  Things like backup restores in the background could in theory cause it, while browsing in DA.
It assumes that usertype=user, and creator=hiscreator exists in all user.conf files.

Create a fix.sh somewhere and fill it with the following code:


cd /usr/local/directadmin/data/users

for r in `ls */reseller.conf | cut -d/ -f1`; do
     echo "fixing Reseller $r ...";

     echo -n '' > $r/users.list

     for u in `grep "^creator=$r$" */user.conf | cut -d/ -f1`; do
         ISUSER=`grep -c usertype=user $u/user.conf`
         if [ "$ISUSER" = "1" ]; then
             echo $u >> $r/users.list

chmod the fix.sh to 755 and run it.
It can be run repeatedly as the users.list files are emptied before the run starts.
Related Helpfiles
CMD_SHOW_ALL_USERS is missing some users.
My monthly bandwidth is not resetting.
I need to rebuild my reseller.list file

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST