• 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.

Resolved How to get the total disk space usage of log files

Inma

Regular Pleskian
Server operating system version
Debian
Plesk version and microupdate number
18.0.52
I would like to know what command to use in debian to show the weight of the logs of the accommodations
and in case of weighing a lot a command to eliminate them at once
I have two servers with 150 accommodations each and as you will understand... it is absurd to have to do it one by one
but first know what they weigh
And so that there is no confusion, I am referring to these logs that rotate and the rotated ones can be eliminated

[Removed images upon user request.]
 
Last edited by a moderator:
The logs from the screenshot are stored in this location:
Code:
# ls -l /var/www/vhosts/system/domain.com/logs/

If you want to see the logs from all domains:
Code:
# ls -l /var/www/vhosts/system/*/logs/
 
Thank you, and know what all these logs weigh together?

I put this command and what else?

ls -l /var/www/vhosts/system/*/logs/
 
If "weigh" means "total size" to you, then the command would be du /var/www/vhosts/system/*/logs/*.
 
Thanks, I'll write down the two commands

And in case you want to delete them all at once because they occupy almost 3GB?

du -ch /var/www/vhosts/system/*/logs/* | grep ¿?¿?¿?
 
Thanks, I'll write down the two commands

And in case you want to delete them all at once because they occupy almost 3GB?

du -ch /var/www/vhosts/system/*/logs/* | grep ¿?¿?¿?

I'm not an expert, but I think it might be safer to change the rotating options. You can rotate the log files by size.
 
I'm not an expert, but I think it might be safer to change the rotating options.
That is true, because the log file handles will still be stored in the services that write the logs elsewise, so just deleting log files may leave the system in a state where new log entries cannot be written, because the file handles no longer have a corresponding file that can be used.
 
To set the log rotation for new, to-be-added subscriptions, use this guide:

For the existing subscriptions, you need to use these guides because the settings in the article mentioned above won't change the log rotations settings in the existing subscriptions:

 
Thanks guys, I thought that, put the smallest logs and that rotate 5 instead of 10 Eliminate fears hahaha Thank you
 
Back
Top