• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Limiting logs to 30 days

Maris

Basic Pleskian
Hello, how do i set a lifetime for all access logs? Like http, nginx etc. Let's say I would like to hold no more than 30 days of logs in my server and do not archive anything past that. So my server do not hold any log info for what happened before 30 days.
Thanks
 
If you talk about the logs of your hosted domains, for example like this: Plesk Panel > Service Plans > Logs & Statistics > Log rotation & Maximum number of log files

see also: Log Rotation
 
Last edited:
Does it include apache logs or just Plesk admin panel access logs? In my case - i need apache http access logs that register every single web-page request.
 
Well my example was for the domain logfiles under
Code:
/var/www/vhosts/system/*/logs
and as in the link above documented also for individual domains. If this is not what you talk about please specify which logfile you mean.
 
Last edited:
Yep the same one, though despite that i have set Log Rotation monthly, max no of log files = 3, compress log files, there's full of archived log files, god knows kept for how long.. what i want is to see only past 30 days logs, nothing more, no archives from previous year, no nothing, pure past 30 days and that's all
 
Well if you like to get this very old archives deleted you can do this on cmd line for example like:
Code:
# find old archive logs older than 180 days
find /var/www/vhosts/system/*/logs/*.gz -mtime +180

# find and delete them
find /var/www/vhosts/system/*/logs/*.gz -mtime +180  -exec rm {} \;
 
Last edited:
Back
Top