• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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