SQL administrative scripts

Hello all,

well, topic does not fit here perfectly, but it's the same with the other forums. So I try here. ;-)

Does anyone use administrative scripts for (My)SQL based ejabberd servers?

For example I would like to remove inactive users automaticly. Sure, I could write a script myself but maybe there are also good scripts available.

Thanks and kindest regards,
Martin

mod_ctlextra / mod_admin_extra and mod_cron

> remove inactive users automaticly

mod_ctlextra/mod_admin_extra provide an ejabberdctl command to remove accounts that were unused in last X days. But I only tested it using internal auth. You can at least try it. If so, please comment if it works or not when using a different auth method.

Regarding periodic calling this command, you can either set a cron task, or use mod_cron.

Some questions about inactive users and cmdline command

Hello all,

I'm thinking about reading the MySQL database to look for inactive users.

I want to check the table "last". Everything in seconds (unix timestamp) which is older than x days gets deleted.

Also I noticed that table "last" contains less entries comparing to the table "users". Is this because users never logged in do not get an entry in "last"?

After the list with inactive users is complete I want to run a cmdline command for every user to delete those users.

This command does not work:

ejabberdctl unregister username@jabberdomain.tld ejabberd@servername

Is this the right command?

Kindest regards,
Martin

ejabberdctl unregister works now :)

Ah... This works:

ejabberdctl unregister username jabberdomain.tld

:-)

But could please somebody tell me about the questions regarding the tables? Thanks! :-)

Yes

Quote:

Also I noticed that table "last" contains less entries comparing to the table "users". Is this because users never logged in do not get an entry in "last"?

Yes, that's the reason.

Deleted 0 users

Too bad, did not work:

> ejabberdctl delete-older-users 365
> Deleted 0 users: []

Any ideas?

Syndicate content