Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7503171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:07:43+00:00 2026-05-29T21:07:43+00:00

I have to write a script where I take a tcpdump on my machine

  • 0

I have to write a script where I take a tcpdump on my machine and on a remote machine “simultaneously”. That is the beginning of capture (0th second) should be simultaneous, so that I can compare the two tcpdumps in my analysis.

Is there a way I can achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:07:44+00:00Added an answer on May 29, 2026 at 9:07 pm

    If you just need approximate time (e.g. with a margin of error in range of, say, 200ms), then just make sure both machines have the same time (e.g. via NTP) and then use e.g. cron to run both commands at the same time.

    If you want this to be more often, you might want to use at command instead of cron. You can do some simple date arithmetics, e.g. see this:

    • Bash date/time arithmetic

    or sleep until the specified time:

    • Bash: Sleep until a specific time/date

    in both scripts (i.e. local and remote), then run the local command and run the command on the remote machine using ssh.

    If you are OK to use e.g. Python, you can make the use of datetime module, e.g. see this:

    • http://www.doughellmann.com/PyMOTW/datetime/

    The idea is pretty much this:

    • Take current time
    • Calculate target time – add some cushion seconds (e.g. 10 seconds)
    • Run both scripts with that time as the parameter (one locally, one remotely with ssh)
    • Sleep until that time in both scripts – if you cannot ssh in 10 seconds or even worse if it takes more than 10 seconds to run local script, you have more serious problems than this one 🙂
    • Run tcpdump in both scripts – they should be pretty much synced up (with some tolerance, but I don’t think it will ever go over 50ms on any recent system)

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to write a Matlab script that does this: The input is 2
I have to write a bash script that makes lot of things. I'd like
I have an upload script that write a index.html file, I modified it to
I need to write a bash script that will take a grepable nmap output
I'm looking to write a script that will take a bunch of .js files,
I need to write a script, probably in Ruby, that will take one block
I have to write a script in Linux, that takes input from user. For
I am looking for a way to write a script that will take around
I have to write a script which will be hosted on differents domains. This
I am not too familiar with python and have to write a script to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.