EPrints Technical Mailing List Archive

Message: #09125


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] How can i delete thousands of fake users?


CAUTION: This e-mail originated outside the University of Southampton.

Hey Florian

Thank you for your support. I had downloaded delete_user from
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fjesusbagpuss%2Fd5fa10ef3915e036f0eb24b4a2ad019f&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C288e5b02df2d4642510e08dadcf26fd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065231798505527%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=ag3t4%2FhOBMdc%2By%2BGF6md8yEKx1qqw61JKIun8a7gxyc%3D&amp;reserved=0
After I run this commad, I got on error:

eprints@eprints:~/bin$ ls -all
total 248
drwxr-xr-x  2 eprints www-data  4096 Dec 13 09:57 .
drwxr-xr-x 16 eprints www-data  4096 Dec 30  2020 ..
-rwxr-xr-x  1 eprints www-data 15838 Jul 17  2020 check_xapian
-rwxr-xr-x  1 eprints eprints   4519 Dec 13 09:57 delete_user
-rwxr-xr-x  1 eprints www-data 83031 Jul 17  2020 epadmin
-rwxr-xr-x  1 eprints www-data  4128 Jul 17  2020 epindexer
....
-rwxr-xr-x  1 eprints www-data  5363 Jul 17  2020 toolbox
-rwxr-xr-x  1 eprints www-data  1783 Jul 17  2020 unit_tests
eprints@eprints:~/bin$ ./delete_user hsr `for ((x=12; x<=13; x++)); { echo -n "$x "; }`
Can't locate EPrints.pm in @INC (you may need to install the EPrints module) (@INC contains: /usr/share/eprints/bin/../../perl_lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./delete_user line 54.
BEGIN failed--compilation aborted at ./delete_user line 54.
eprints@eprints:~/bin$

I use eprints 3.4.2, OS Ubuntu 20.04.4 LTS
Maybe you can help me further?

Greetings
Christian


-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk <eprints-tech-bounces@ecs.soton.ac.uk> On Behalf Of Florian Heß via Eprints-tech
Sent: Freitag, 9. Dezember 2022 11:03
To: eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] How can i delete thousands of fake users?

CAUTION: This e-mail originated outside the University of Southampton.

Note xargs takes care of any limits opposed by the kernel concerning command line length. `xargs -a fake_users_ids.txt bin/delete_user REPOID` should do all fine.

Regards
F Hess

Am 09.12.22 um 02:34 schrieb David R Newman via Eprints-tech:
> Hi Christian,
>
> You could just add all the user IDs one after another to the
> delete_user
> script:
>
> ./delete_user REPO_ID `for ((x=5; x<=25590; x++)); { echo -n "$x "; }`
>
> However, I suspect that command may be too long for bash (i.e. your
> shell).  You could use xargs but you probably don't want to call the
> delete_user script 25000+ times, as this will be slow compared to
> calling it just a few times with multiple arguments. So it may be
> better to write a bash script that passes 1000 user IDs at a time:
>
> #!/bin/bash
> for ((i=5;  i<=25590; i=i+1000)); do
>     ./delete_user REPO_ID `for ((j=i; j<i+1000 && j<=25590; j++)); {
> echo -n "$j "; }` done
>

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C288e5b02df2d4642510e08dadcf26fd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065231798661786%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=TaG%2FJkRju71YomVvyKrGRlOTcPM75r9ToE5kHlHsqCc%3D&amp;reserved=0
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C288e5b02df2d4642510e08dadcf26fd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065231798661786%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=nTdbdURbtLsJiID7wU3JASvz93KnC1zGK74sU6thQeQ%3D&amp;reserved=0