- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- tcpdump in cron runs only for 1 minute
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- Report Inappropriate Content
08-31-2017 03:05 AM
08-31-2017 03:05 AM
tcpdump in cron runs only for 1 minute
We created an entry in cron of RHEL 6.5 to run tcpdump fro 30 minutes:
0 12 * * * /usr/bin/nohup tcpdump -ttt -vvv -s 65535 -i bond0 -w /tmp/bond0.pcap &
30 12 * * * killall -15 tcpdump
The tcpdump runs but only for 1 minute.
We tried adding TMOUT:
0 12 * * * TMOUT=0; /usr/bin/nohup tcpdump -ttt -vvv -s 65535 -i bond0 - w /tmp/bond0.pcap &
But still runs only for 1 minute.
Any idea will be appreciated.
Thanks
Noel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-19-2017 03:30 AM
10-19-2017 03:30 AM
Re: tcpdump in cron runs only for 1 minute
When you use "nohup" that way, there should be a "nohup.out" file in the user's home directorey after running that cron job - and since tcpdump must normally be run as root, the file is probably /root/nohup.out.
What does that file say? Are there any error messages?
The -ttt and -vvv options are not necessary if you're using the -w option to write the actual dump into a file.
The TMOUT timeout applies only for interactive shells waiting for input, so it has no effect when a non-interactive session (=the one started by cron) is running tcpdump.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP