[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[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&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C083ce2d8375e4421dac408dadcf4112f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065238115170775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hkZdTJTWGL%2BusyekfyO3UjY1WiFEcW8o5rtFiSiTKhg%3D&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&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C083ce2d8375e4421dac408dadcf4112f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065238115170775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hkZdTJTWGL%2BusyekfyO3UjY1WiFEcW8o5rtFiSiTKhg%3D&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 <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
> 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&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C083ce2d8375e4421dac408dadcf4112f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065238115170775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=m72fHNj4fSVTeK6LqGb%2FbE8fEJxwW%2FsR%2BQ0uP5Dfluk%3D&reserved=0
> *** EPrints community wiki:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C083ce2d8375e4421dac408dadcf4112f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065238115170775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SUBNBQsFjyl%2B%2BOJO5WJEEgFwguKmXzhg2RNGdjC%2BuJo%3D&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&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C083ce2d8375e4421dac408dadcf4112f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065238115170775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=m72fHNj4fSVTeK6LqGb%2FbE8fEJxwW%2FsR%2BQ0uP5Dfluk%3D&reserved=0
> *** EPrints community wiki:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C083ce2d8375e4421dac408dadcf4112f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638065238115170775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SUBNBQsFjyl%2B%2BOJO5WJEEgFwguKmXzhg2RNGdjC%2BuJo%3D&reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20221213/0586d3b2/attachment-0001.html