Hey Guys -
Being in IT, I am a big fan of Tasker for Android and when looking for a similar app for the PC recently, I discovered VisualCron. So far, I love it! I have already created a few profiles for my admin tasks, but hit a snag today and have a quick question, please.
Unfortunately,
NGINX doesn't provide config options which rotate log files in Windows that I can find, so I'm trying to use VisualCron. The two primary log files it uses can easily grow to be over a gigabyte each in just a few days. These files are text-based with the newest events at the bottom. Below is one of the lines from a log so you can see the formatting:
10.25.0.56 - - [26/Sep/2018:12:38:12 -0500] "POST /api/?v1/ping HTTP/1.1" 200 400 "https://mydomain.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
Ideally, I'd like to truncate them on a schedule so that data within which is older than 2 weeks is removed. I'd assume I would use regular expression and perhaps a variable set as the current date to delete or rewrite each log. Is this feasible without tons of work?
I'd also settle for just deleting the files on a schedule if needed and tried to do this already - however - I couldn't find out how to add a trigger or event condition where it would proceed only if the file was a over a specific size. I do see that the "Delete File" event allows you to set a condition for size, however I am wanting to set the condition on the Job level since I don't want it performing the other tasks such as stopping / starting services if nothing is going to be deleted.
Any suggestions for either / both of the tasks above? Thanks!
Edited by moderator
2018-10-31T13:48:27Z
|
Reason: Not specified