Website Logo. Upload to /source/logo.png ; disable in /source/_includes/logo.html

Zuzur’s wobleg

technology, Internet, and a bit of this and that (with some dyslexia inside)

Notebook: Running a Unix Command for a Given Amount of Time

| Comments

Sometimes, you need to run a command (capture, etc …) for a given amount of time. Here’s an example of a script capturing mysql traffic for half an hour :

wait.sh
1
2
3
4
5
    #!/bin/sh
    DATE=`date +%Y%m%d%H%M%S`
    tcpdump -i eth0 port 3306  -s 65535 -x -n -q -tttt > capture-$DATE.out &
    sleep 1800
    kill $!

Comments