EPrints Technical Mailing List Archive

Message: #09124


< 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.

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