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 log rotation works with logrotate
Viewed 5039 times since Fri, Nov 30, 2018
12 Linux Rsync Options in Linux Explained
Viewed 12191 times since Wed, Oct 31, 2018
An easier way to manage disk decryption at boot with Red Hat Enterprise Linux 7.5 using NBDE
Viewed 7760 times since Mon, Aug 6, 2018
LVM: Reduce an existing Volume Group by removing one of its disks
Viewed 2633 times since Sat, Jun 2, 2018
Inxi – A Powerful Feature-Rich Commandline System Information Tool for Linux
Viewed 19037 times since Sat, Jun 2, 2018
OpenSSL: Check If Private Key Matches SSL Certificate & CSR
Viewed 3320 times since Mon, Feb 18, 2019
ZPOOL: Grow a zpool by adding new device(s)
Viewed 6183 times since Sun, Jun 3, 2018
How to find the largest files and directories in Linux?
Viewed 3547 times since Sun, May 20, 2018
Linux Network (TCP) Performance Tuning with Sysctl
Viewed 11851 times since Fri, Aug 3, 2018
Tropienie pożeracza dysku
Viewed 2395 times since Thu, May 24, 2018