Im looking for a way to have a command running 24hrs per day and generating an output file per day.
The command Im talking about is this one:
# ngrep -O dump.pcap -W byline -d xxxx port 99999
filter: (ip) and ( port 99999)
output: dump.pcap <--- output file
So the goal would be to have it running all day long and every end of day it would generate a new file.. (not sure if its possible or not...)...
I thought on having something on the crontab that somehow would do this "switch" of files every end of day...
Just to illustrate what Im talking about if its not clear...:
1- The command would inside script that would run on the background.. everyday on the crontab (not sure if its the best solution - the crontab one)
2- Every end of day it would generate a new output file (not sure if this is a code to go in the "script" itself or some command on the crontab).. so I would have:
dump<date_day_2>.pcap (created on the start of the "day 2"..
3- What would be your suggestion to have something that would delete files older than 10 days from the "script" output files? Something on the script itself? If so, can you suggestion a command line for this?