There are some log files created after a certain amount of time with the time stamp.
/mylog/path
Log_file_2018-07-19-22-55-31Z.tgz
Log_file_2018-07-20-01-29-11Z.tgz
Log_file_2018-07-20-10-36-49Z.tgz
Log_file_2018-07-21-18-26-36Z.tgz
I need to delete older logs based on date. For example, I want only last 5 days logs and older logs should be deleted. Num of log files created daily varies. How to achieve this?
logrotate
? – Kusalananda Aug 02 '18 at 06:17