Need a bash shell script which will delete lines from file
I have an Apache WEB server which has a very limited space for logging connections. Monitor software polls the web server every 30 seconds from the same IP address. This causes 2 entries per minute.
I would like to have a shell script run as a cron job daily to:
1. Scan the log file for the IFS field with the monitor machines IP address.
2. Delete all entries from this machine in the log file.
3. IF the log file is missing the shell script will exit.
I've been playing with shell scripts, but cannot seem to find a workable script to accomplish this task
Sounds like a job for logrotate which is literally installed by default on every distribution I've ever used.
|All times are GMT -5. The time now is 04:40 PM.|