D
D
DanielPo2022-01-28 12:36:18
linux
DanielPo, 2022-01-28 12:36:18

How to create a script that will clean up a file?

I need to create a script that will check the file size and if it exceeds the allowed file weight, then clear it, how can I do this?
__________________________________________________________________________________________________________________________________
Suddenly someone
needs cPanel on the server, I went to Cron Jobs, set the time and entered the following command - echo > /home/{name}/public_html/{site}/error_log and now once at a certain time my logs are cleared

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfg21, 2022-01-28
@DaniilPo

do not soar your brains and and write rules for logrotate

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question