EPrints Technical Mailing List Archive

Message: #08160


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

Re: [EP-tech] Removing all user accounts with no deposits


Hi Martin,

Yes, this is the correct method for deleting users if they have no deposits.  If they did, I would recommend transferring ownership of deposits before removing a user.  I am assuming you have quite a long list so you cannot go the "Manage Records -> Users -> Remove" option would be overly time consuming.  Therefore you need will need to write a somewhat bespoke script for doing this, like the one at:

http://drn.eprints-hosting.org/stuff/remove_users 

You will need to put this in the bin directory of your archive, make it executable and run as follows:

./remove_users ARCHIVE_NAME USER_LIST_FILENAME

Substitute ARCHIVE_NAME for your archive's name and USER_LIST_FILENAME for the filename(and path) or a file containing new line separated user IDs, e.g.

2
5
7
11
28

Regards

David Newman

On 12/05/2020 10:06, Martin Hawksey via Eprints-tech wrote:
Hello all,

Sorry to join the list with what is probably a noob question. Our eprints repo has a number of spam accounts and we would like to remove all user accounts with no live deposits. Via the deposit and user reporting I'm happy I can create a list of user id's for removal but then I reach the limits of my understanding, not being a Perl user/dev. 

I've looked on the wiki and more widely for a solution and I can find some snippets like https://wiki.eprints.org/w/API:EPrints/DataObj/User#remove    

I was wondering if anyone on the list has had to go through a similar process and has a script they can share?

Many thanks
Martin

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

Virus-free. www.avg.com