Forum Discussion

1 Reply

  • Hi,

    you can do use the following procedure:

    crontab -e

    and then add the line

    30 17 * * * /usr/sbin/tcpdump -G 12600 -W 1 -s 3000 -w /home/ubuntu/capture-file.pcap port 5060 or portrange 10000-35000

    • -G flag indicate number of second for dump to run, this example runs daily from 5:30 PM to 9:00 PM
    • -W is the number of iterations tcpdump will execute
    • Cron job will not be added until you save and exit the file
    • This example is for capturing packets of an Asterisk phone server

    Source: https://stackoverflow.com/questions/25731643/how-to-schedule-tcpdump-to-run-for-a-specfic-time-of-period

    Let me now if you need additional help.

    Regards