[horde] clean DB from unused users (old users)

Steffen skhorde at smail.inf.fh-bonn-rhein-sieg.de
Mon Jun 16 06:39:35 UTC 2014


On Sat, 14 Jun 2014, Stefan Johänntgen wrote:

> Thanks, but where do I put the xargs < users-to-remove
> horde-remove-user-data --force --continue

> And there is no file horde/bin/horde-remove-user-data to edit

What version of Horde do you use? PEAR installed the script to 
/usr/bin/horde-remove-user-data on my system.

xargs < users-to-remove horde-remove-user-data --force --continue
is actually a command, xargs < users-to-remove reads the file 
users-to-remove and calls the command horde-remove-user-data --force 
--continue for any token find within the file, see
man xargs
xargs bypasses the problem, if the command line gets too long.

>
> Zitat von Steffen <skhorde at smail.inf.fh-bonn-rhein-sieg.de>:
>
>> Stefan Johänntgen wrote:> Hi,
>>> I have the authentication with the existing IMAP e-mail accounts.
>>> Is there a script that I can delete a user from the horde database?
>>> Because on the Horde frontend I can not manage the users. But in the
>>> database are users (horde_prefs, turba_sharesng etc)
>>> I want to clean up the database.
>>> Many Thanks to Horde Team!
>> 
>> see horde-remove-user-data in conjunction with this patch:
>> http://bugs.horde.org/ticket/12997
>> 
>> I did it so:
>> 
>> 1. generate user list in Horde:
>> for me, I query the Postgres SQL DB and dump into a file from psql
>> SELECT DISTINCT pref_uid FROM horde_prefs \g /tmp/users
>> 
>> 2. check above list, which users are gone with your user database
>> 
>> 3. xargs < users-to-remove horde-remove-user-data --force --continue
>> 
>> --Steffen

-- 
Steffen


More information about the horde mailing list