Odpalenie polecenia tylko na jedną godzinę

Użycie polecenia timeout do uruchomienia wybranego polecenia na określony czas działania:

timeout 1h tcpdump -n -i eth0 -w network.pcap not host 192.168.1.5

lub

tcpdump -n -i eth0 -w & pid=$! ; (sleep 3600 ; kill $pid)
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
How to encrypt a partition with DM-Crypt LUKS on Linux
Viewed 9070 times since Fri, Jul 13, 2018
LVM basic
Viewed 2885 times since Sat, Jun 2, 2018
How to retrieve and change partition’s UUID Universally Unique Identifier on linux
Viewed 4291 times since Tue, Jul 17, 2018
Linux RAID Mdadm Cheat Sheet
Viewed 6513 times since Fri, May 15, 2020
30 Handy Bash Shell Aliases For Linux / Unix / MacOS
Viewed 6174 times since Thu, Feb 11, 2021
Secure Secure Shell
Viewed 12968 times since Fri, Aug 21, 2020
Need to set up yum repository for locally-mounted DVD on Red Hat Enterprise Linux 7
Viewed 4171 times since Mon, Oct 29, 2018
Using grep to find string in files
Viewed 3249 times since Fri, May 15, 2020
How to use yum command on CentOS/RHEL
Viewed 12097 times since Wed, Oct 17, 2018
Telnet – Send GET/HEAD HTTP Request
Viewed 4705 times since Mon, Feb 18, 2019