There is a CRS328-24P-4S+ (arm) v7.4, on which the User Manager 5 is configured. But it stopped working because, out of disk space. How can I clear the database of old sessions? Can a flash drive be used to store a database?
user-manager/database/optimize-db
Optimizing database…
Failed to optimize database
action timed out - try again, if error continues contact MikroTik support and send
a supout file (13)
bad idea running user manager on a switch
I answer myself
:foreach i in=[/user-manager/session/find] do { /user-manager/session/remove $i; }
/user-manager/database/optimize-db
:foreach i in=[/user-manager/session/find] do { /user-manager/session/remove $i; }
/user-manager/session remove [find]
What would this line look like then?
:foreach i in=[/user-manager/session/find terminate-cause=lost-service] do { /user-manager/session/remove $i; }
/user-manager/session remove [find where terminate-cause=lost-service]
Agree
That’s the issue with many users of RouteROS. When everything’s possible, then it’s suddenly possible to do stupid things, and then you run into problems.
Final version
/user-manager/session/remove [find where active=no]
/user-manager/database/optimize-db