2

I've the following job in /etc/crontab:

@hourly root /usr/bin/script

Here is the script:

#!/bin/bash
killall tcpdump
date=$(date +%G%m%d-%k%M)
tcpdump -n port 5060 -w /media/SIPTraces/filename-$date.pcap -s 0 &

This runs beautifully(ish).

However, eventhough I have the @hourly time parameter, it only runs hourly between 10am and midnight. It clearly stops the job (or runs it) as the TCPDUMP file ends at midnight. But then another file is not created until 10am the next day.

Any ideas?

muru
  • 193,181
  • 53
  • 473
  • 722

0 Answers0