On 08/02/2018 13:23, Carsten Haitzler wrote:
On Thu, 08 Feb 2018 12:41:06 +0000 Bertrand Jacquin <bertr...@jacquin.bzh> said:

> you don't need to manually go close every ticket. just find one ticket
> and the
> problem user and tell me. it's possible to wipe the mess easily enough
> on the
> cmdline. i put together a small script that can qeury the sql db and
> nuke the
> user AND tasks they authored:
>   sudo ./phab-nuke-spam-user.sh jdnjka

Hug no, that will create inconsistency in the database, instead the
"remove destoy" tool should be used as explained on

   $ sudo -u apache /srv/web/phab.enlightenment.org/bin/remove destroy

that;'s actually what the script does... but it identifies all the tasks created by the user and nukes those separately then nukes the user.. it uses
the pha remove tool to do it, but mysql to query to find out what to
remove... :)

Oh alright, we're all good then, thanks!

specifically this is it:


M="mysql -sN -D"
USERPHID=`$M phabricator_user -e \
"select phid from user where userName=\"$USER\";"`

for ID in \
`$M phabricator_maniphest -e \
"select id from maniphest_task where authorPHID='"$USERPHID"';"`;
  echo Nuke T$ID
  /srv/web/phab.enlightenment.org/bin/remove destroy --force "T$ID"

echo Nuke @$USER
/srv/web/phab.enlightenment.org/bin/remove destroy --force "@$USER"


Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
enlightenment-devel mailing list

Reply via email to