<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[Totti的部落格]]></title> 
<link>https://iam.ittot.com/index.php</link> 
<description><![CDATA[记录我的生活，收集我的收集]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[Totti的部落格]]></copyright>
<item>
<link>https://iam.ittot.com/read.php/.htm</link>
<title><![CDATA[重建directadmin user.list用户]]></title> 
<author>Totti &lt;totti5116@163.com&gt;</author>
<category><![CDATA[收集]]></category>
<pubDate>Fri, 30 Nov 2012 01:32:58 +0000</pubDate> 
<guid>https://iam.ittot.com/read.php/.htm</guid> 
<description>
<![CDATA[ 
	If your users.list files for all of your Resellers/Admins becomes corrupt, you can create and run this script to rebuild them all.<br/>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).&nbsp;&nbsp;Things like backup restores in the background could in theory cause it, while browsing in DA.<br/>It assumes that usertype=user, and creator=hiscreator exists in all user.conf files.<br/><br/>Create a fix.sh somewhere and fill it with the following code:<br/><div class="code">#!/bin/sh<br/><br/>cd /usr/local/directadmin/data/users<br/><br/>for r in `ls */reseller.conf &#124; cut -d/ -f1`; do<br/>&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;fixing Reseller $r ...&quot;;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; echo -n &#039;&#039; &gt; $r/users.list<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; for u in `grep &quot;^creator=$r$&quot; */user.conf &#124; cut -d/ -f1`; do<br/>&nbsp;&nbsp;&nbsp;&nbsp; &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ISUSER=`grep -c usertype=user $u/user.conf`<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if &#91; &quot;$ISUSER&quot; = &quot;1&quot; &#93;; then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo $u &gt;&gt; $r/users.list<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<br/>&nbsp;&nbsp;&nbsp;&nbsp; &#125;;<br/>&nbsp;&nbsp;&nbsp;&nbsp; done;<br/>&#125;;<br/>done;</div><br/><br/>chmod the fix.sh to 755 and run it.<br/>It can be run repeatedly as the users.list files are emptied before the run starts.
]]>
</description>
</item><item>
<link>https://iam.ittot.com/read.php/.htm#blogcomment</link>
<title><![CDATA[[评论] 重建directadmin user.list用户]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://iam.ittot.com/read.php/.htm#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>