Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/sharedra.../guds_mod...
File: aux.py
import platform
[0] Fix | Delete
from pathlib import Path
[1] Fix | Delete
from tabulate import tabulate
[2] Fix | Delete
from guds_modules.base import ModuleBase
[3] Fix | Delete
[4] Fix | Delete
[5] Fix | Delete
def run_aux():
[6] Fix | Delete
"""Show size of common directories and logs"""
[7] Fix | Delete
dir_list = [
[8] Fix | Delete
'/var/lib/mlocate',
[9] Fix | Delete
'/etc/apache2/logs',
[10] Fix | Delete
'/etc/apache2/domlogs',
[11] Fix | Delete
'/home/moveuser',
[12] Fix | Delete
'/var/log/slowqueries',
[13] Fix | Delete
f'/var/lib/mysql/{platform.node()}.err',
[14] Fix | Delete
]
[15] Fix | Delete
[16] Fix | Delete
table = []
[17] Fix | Delete
headers = ['Path', 'Size']
[18] Fix | Delete
[19] Fix | Delete
for path in dir_list:
[20] Fix | Delete
table.append((path, ModuleBase.get_size(Path(path))))
[21] Fix | Delete
[22] Fix | Delete
print(tabulate(table, headers, tablefmt="fancy_grid"))
[23] Fix | Delete
[24] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function