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
Learn how to align an SSD on Linux
Viewed 12270 times since Fri, May 15, 2020
How to use yum command on CentOS/RHEL
Viewed 10870 times since Wed, Oct 17, 2018
Migrate a Linux System from Red Hat Enterprise to CentOS
Viewed 10231 times since Fri, May 15, 2020
Linux nslookup Command Examples for DNS Lookup
Viewed 8857 times since Sat, Sep 29, 2018
Linux Kernel /etc/sysctl.conf Security Hardening
Viewed 23440 times since Fri, Aug 3, 2018
RHEL: XFS basic operations
Viewed 15877 times since Sat, Jun 2, 2018
Yum Update: DB_RUNRECOVERY Fatal error, run database recovery
Viewed 3937 times since Fri, Jan 17, 2020
watchdog How to restart a process out of crontab on a Linux/Unix
Viewed 5893 times since Tue, Jul 31, 2018
How log rotation works with logrotate
Viewed 4804 times since Fri, Nov 30, 2018
Transform XML to CSV Format | Unix String Pattern Manipulation The Ugly Way
Viewed 5198 times since Sun, Jan 9, 2022