How can I delete multiple users using delete-user command?
One of my hosts has too many users and it is killing virtualmin/usermin.
I tried virtualmin delete-user --domain DOM --user US1 & virtualmin delete-user --domain DOM ... but I get error “failed to lock file postfix/virtual after 5 mins” and it breaks the process.
Can you help me somehow? Using virtualmin web and multiselect is impossible as it takes forever to load user page.
can webmin users and ground be used? you can multiselect there.
Opps read what you said, why would it be so slow to load, you have issues if thats slow.
Thank you Illia,
I tried your command but it seems it removes only the last user on the list.
Because of (probably) some issues I have, this delete process takes about 6-10 minutes per user. My idea was to list 50 and put it in background so I don’t need to wait.
Do you think it might be faster if I disable server until I clear these unwanted users?
I have made python script that picks and parse csv file uploaded by my client. Then I use virtualmin api to add those users. It is for their employees and that fluctuates. I forgot to remove those who left - so now I need to clear 5000
It is nice to know that Virtualmin can be pushed to such limits. And only yesterday, in an unrelated incident, I was speaking with an admin in Germany who has integrated Virtualmin with a telco to offer a very unique solution and we were discussing how it could be made to scale. He has about 200 virtual servers on a single install of Virtualmin and I told him that I had managed to scale a dedicated server to almost a thousand virtual serves.
Kudos to the Virtualmin team who keep Virtualmin light by working directly with the config files of a server, unlike some panels which go about it in a round-about manner which consumes more resources to run the panel and limits the things that an admin can do by editing files directly on a system.
And in addition to that consideration, how much mail is stored in the user / mailbox that you wish to delete? If there is lots and lots of mail then it might take longer to delete.
Now there is an idea. Instead of disabling the entire virtual server to speed things up, you could disable the login of a user of the virtual server.
See if disabling a user is faster on your very loaded server than deleting a user / mailbox. Both produce similar results - the user’s access to the mailbox is denied and mail sent to the mailbox will bounce.
I wouldn’t worry if it was just a quick and short lived surge. Perl will do that to a system and I sometimes think that it is a good thing.
But if it takes 6 minutes to delete a user and your processor is at 96% during that time, that’s a different matter altogether, even if you have multiple cores.
There was a bug in Virtualmin 7.9.0 that was later fixed in Virtualmin 7.10.0. Try upgrading to the latest version and checking again. It should work …