Wonder if anyone can help.
I have a log which starts from Dec 4 and is constantly updated. Rather than empty the log, I want to just keep the last 7 days worth.
I have tried find . -mtime +7 , but this cmd works well when looking for files within a filesystem, I want to just edit that log file ,
I have tried some awk cmds, but unsure how to progress further .
Any ideas greatly appreciated
Regards
visvid
I have a log which starts from Dec 4 and is constantly updated. Rather than empty the log, I want to just keep the last 7 days worth.
I have tried find . -mtime +7 , but this cmd works well when looking for files within a filesystem, I want to just edit that log file ,
I have tried some awk cmds, but unsure how to progress further .
Any ideas greatly appreciated
Regards
visvid