[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



CAUTION: This e-mail originated outside the University of Southampton.
Hey David and Florian

So sorry, i didn't read about the file location.
Now everything works fine. Thanks for the great support.

Greetings
Christian


From: David R Newman <drn at ecs.soton.ac.uk>
Sent: Dienstag, 13. Dezember 2022 11:23
To: eprints-tech at ecs.soton.ac.uk; SGI Support | OST - Ostschweizer Fachhochschule <sgi-support at ost.ch>; Florian He? <hess at ub.uni-heidelberg.de>
Subject: Re: [EP-tech] How can i delete thousands of fake users?

Hi Christian,

In the comment at the top of 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%7Cb9ea98ea58dd407dc25e08dadd1bcf0e%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065409241643324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&amp;sdata=XIp2Y8cXcdPzZEMRKaDeKBVV7wQceCdQr0sVztSqtgQ%3D&amp;reserved=0 it says you may need to change the FindBin path on line 52 if you do not put the script at:

[EPRINTS_ROOT]/bin/local/delete_user

I would advise creating a local directory under your current [EPRINTS_ROOT]/bin/ directory and moving the delete_user script there before re-running the command.

Regards

David Newman
On 13/12/2022 10:11 am, SGI Support | OST - Ostschweizer Fachhochschule via Eprints-tech wrote:

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%7Cb9ea98ea58dd407dc25e08dadd1bcf0e%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065409241643324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&amp;sdata=XIp2Y8cXcdPzZEMRKaDeKBVV7wQceCdQr0sVztSqtgQ%3D&amp;reserved=0

After I run this commad, I got on error:



eprints at 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 at 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 at 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 at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> <eprints-tech-bounces at ecs.soton.ac.uk><mailto:eprints-tech-bounces at ecs.soton.ac.uk> On Behalf Of Florian He? via Eprints-tech

Sent: Freitag, 9. Dezember 2022 11:03

To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at 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%7Cb9ea98ea58dd407dc25e08dadd1bcf0e%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065409241643324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&amp;sdata=ApaN4DEn%2BhZ2zlu4d6xFIe4AUxwp5mX54ICcDDzLWsw%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%7Cb9ea98ea58dd407dc25e08dadd1bcf0e%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065409241643324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&amp;sdata=8%2BHYVdEz%2BqvpdNRztCTSBD0NtVIoHAoXskCvx%2BdZe9k%3D&amp;reserved=0



*** 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%7Cb9ea98ea58dd407dc25e08dadd1bcf0e%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065409241799613%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&amp;sdata=3UG%2FZU4TlvJ4VMAtvdzmA3S8Wyty4PPeOcygj%2FX%2FdHk%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%7Cb9ea98ea58dd407dc25e08dadd1bcf0e%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065409241799613%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&amp;sdata=l3XdsxfZfERhc7AyvWq3r8aXjzQisGefhKdwXapFsyM%3D&amp;reserved=0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20221213/567dc845/attachment-0001.html