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
Open SSL Creating Certificate Signing Request — CSR Generation
Viewed 1623 times since Mon, Feb 18, 2019
Linux Linux Network Statistics Tools / Commands
Viewed 8706 times since Mon, Sep 21, 2020
Using stunnel and TinyProxy to obfuscate HTTP traffic
Viewed 6257 times since Fri, Sep 28, 2018
Use inotify-tools on CentOS 7 or RHEL 7 to watch files and directories for events
Viewed 13540 times since Fri, Jul 27, 2018
Use Fail2ban to Secure Your Server
Viewed 13945 times since Fri, Jul 5, 2019
systemd Auto-restart a crashed service in systemd
Viewed 2478 times since Fri, Jan 17, 2020
CentOS / RHEL 7 : Configuring an NFS server and NFS client Linux NFS
Viewed 15931 times since Fri, Feb 21, 2020
How to create a Systemd service in Linux
Viewed 2421 times since Mon, Dec 7, 2020
Oracle Linux 7 – How to audit changes to a trusted file such as /etc/passwd or /etc/shadow
Viewed 2654 times since Wed, Jul 25, 2018
LVM: Extend an existing Volume Group by adding a new disk
Viewed 1778 times since Sat, Jun 2, 2018