- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- IP trace in crontab
Operating System - HP-UX
1823062
Members
3288
Online
109645
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2011 11:55 AM
тАО03-28-2011 11:55 AM
Hi All
I need a to create a script that needs to run IPTRACE at 3:00 AM every day and stops at 9:00 AM every day
Command to be excecuted
iptrace -a -i en0 -s 192.168.20.5 -b -d 165.130.149.28 -p 9081 /opt/isv/WAS51/trace/webtrace280311.out
I need a to create a script that needs to run IPTRACE at 3:00 AM every day and stops at 9:00 AM every day
Command to be excecuted
iptrace -a -i en0 -s 192.168.20.5 -b -d 165.130.149.28 -p 9081 /opt/isv/WAS51/trace/webtrace280311.out
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2011 12:02 PM
тАО03-28-2011 12:02 PM
Solution
Hi,
I have a fast solution for you.
Your crontab will look like this:
0 3 * * * /tmp/your_script.sh
your_script.sh
#!/bin/sh
iptrace -a -i en0 -s 192.168.20.5 -b -d 165.130.149.28 -p 9081 /opt/isv/WAS51/trace/webtrace280311.out
Another line at cron
0 9 * * * /tmp/kill_your_script.sh
kill_your_script.sh
#!/bin/sh
ps -ef | grep -i your_script.sh | awk '{printf $2}' | xargs kill -9
It should work like that.
Marco,
I have a fast solution for you.
Your crontab will look like this:
0 3 * * * /tmp/your_script.sh
your_script.sh
#!/bin/sh
iptrace -a -i en0 -s 192.168.20.5 -b -d 165.130.149.28 -p 9081 /opt/isv/WAS51/trace/webtrace280311.out
Another line at cron
0 9 * * * /tmp/kill_your_script.sh
kill_your_script.sh
#!/bin/sh
ps -ef | grep -i your_script.sh | awk '{printf $2}' | xargs kill -9
It should work like that.
Marco,
Just unplug and plug in again ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2011 12:11 PM
тАО03-28-2011 12:11 PM
Re: IP trace in crontab
00 03 * * * iptrace -a -i en0 -s 192.168.20.5 -b -d 165.130.149.28 -p 9081 /opt/isv/WAS51/trace/webtrace280311.out
This starts it at 0300. To stop it you would need to start another script at 0900 to find and kill it.
Also, you may want to write a script for the iptrace case, so you can record the PID, sleep for 6 hours and have that script kill iptrace:
iptrace -a -i en0 -s 192.168.20.5 -b -d 165.130.149.28 -p 9081 /opt/isv/WAS51/trace/webtrace280311.out &
PID=$!
sleep $(( 6 * 60 * 60 )) # sleep 6 hours
kill $PID
This starts it at 0300. To stop it you would need to start another script at 0900 to find and kill it.
Also, you may want to write a script for the iptrace case, so you can record the PID, sleep for 6 hours and have that script kill iptrace:
iptrace -a -i en0 -s 192.168.20.5 -b -d 165.130.149.28 -p 9081 /opt/isv/WAS51/trace/webtrace280311.out &
PID=$!
sleep $(( 6 * 60 * 60 )) # sleep 6 hours
kill $PID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2011 08:04 AM
тАО03-29-2011 08:04 AM
Re: IP trace in crontab
Thanks for the valuable support ..I could find the solution from this thred
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP