Deleting All Tickets

roarkh

Verified User
Joined
Aug 30, 2005
Messages
139
Location
Bellingham, WA
Hi everyone,

I noticed today that a huge number of messages on my admin account had added up to the point where they are using quite a bit of space on my hard drive. After digging around I found that the following folder is using up over 850mb of space...

Code:
/usr/local/directadmin/data/tickets

So, I logged into the control panel as the admin user, went to messages and cleared all message using the button at the bottom of the list, I also went into the Brute Force monitor and deleted every messages labeled "Brute Force Attack Detected".

It seemed to work, all of the messages disappeared from the messages list so I thought I was done. However, when I went back and checked the folder listed above all of the data is still there, still using up 859mb of space. I've gone through and looked at some of the tickets and there are definitely still old "Brute Force Attack" messages in there that don't seem to have actually been deleted even though they are not showing up in the message list anymore.

Can anyone tell me what I might have done wrong, how can I get back all of the hard drive space that these deleted tickets still seem to be using?
 
Ok, so it's normal behavior that when the messages are deleted from the list that they are not actually deleted from the server? That seems strange to me but easy to deal with. I'll just blast everything away in the tickets folder that is more than 30 days old. I would not be worried about keeping them around except that my root partition reached 80% full which triggered a warning message from DirectAdmin.

Thank you for your help.
 
Yes, that's right. Tickets do not get physically removed if you delete them in Directadmin web-interface.
 
First ensure that all User tickets.list files are also empty, else you'll run into issues.
How can you do that in a quick way?

And why are tickets not pysically removed? This is confusing because indeed we get the impression they are also deleted from the file system.
There should be an option for that, but I'm still curious to the reason why it's not done when removing from the DA web interface.
 
Thank you, but why aren't they deleted when deleted from the DA interface?

And another question... arent they deleted at a certain moment automatically for example after 30 days?
 
Actually I don't have answers on these questions. Sure you can find more information in old topics, as far as I remember Andrea wrote a script for managing or removing old tickets from disk. So try and find it.
 
I know about that script but thanks for mentioning it.
However I would just like to know why there are not deleted, or at a certain time. So I will ask DA support.

Thank you!
 
Hi guys,

I believe you're after this:
https://www.directadmin.com/features.php?id=1696
Code:
delete_messages_days=0
delete_tickets_days=0
where you'd set them to however many days you want.

If either is >0, it's triggered after the nightly tally is done, just before the tally_post.sh.

When it runs, it's going to be checking every single ticket in:
Code:
/usr/local/directadmin/data/tickets/*/*/*
so would bit somewhat of a disk I/O hit for each run, so if you do use it, keep it as low as you're willing, so the number of files to parse is lower.
Or just turn it on from time to time, but then off again after the tally is done so it's not run every night.

The reason why deleting a message/ticket in the GUI doesn't actually remove the file, is because a message can be sent to many Users, so for simplicity it just removes it from the current User's tickets.list file, so that other Users can still see it (eg: mass messages).
In hind-sight, this really doesn't happen too often, so DA could be smarter to figure out if any other Users have a copy of it and fully remove it from disk (I'll call that a feature request for now).

John
 
A feature request is nice too. I don't know how difficult this is, but maybe it can be adjusted to only delete tickets marked read or not present in tickets.list anymore. That would be nice indeed.

Thank you for the answer!
 
Back
Top