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
20 IPtables Examples For New SysAdmins
Viewed 1855 times since Fri, May 15, 2020
How to Synchronize Directories Using Lsyncd in Linux
Viewed 12944 times since Wed, Oct 31, 2018
Open SSL Creating Certificate Signing Request — CSR Generation
Viewed 1590 times since Mon, Feb 18, 2019
ZPOOL: Add a mirror to a concat zpool
Viewed 3189 times since Sun, Jun 3, 2018
RHEL: Reinstalling Boot Loader on the Master Boot Record (MBR)
Viewed 2940 times since Sun, May 27, 2018
SSL HowTo: Decode CSR
Viewed 4416 times since Mon, Feb 18, 2019
How to manage Linux password expiry with the chage command
Viewed 10884 times since Tue, Sep 11, 2018
List usernames instead of uids with the ps command for long usernames
Viewed 1991 times since Wed, Jul 25, 2018
How to clear swap memory in Linux
Viewed 1577 times since Mon, Nov 23, 2020
How to stop and disable auditd on RHEL 7
Viewed 38171 times since Tue, Aug 6, 2019