Y
Y
Yourmind2019-12-14 23:01:18
linux
Yourmind, 2019-12-14 23:01:18

How to set a timer when running a file in bash?

Good day
I have a question
. I have a certain python file that has an output when it finishes bypassing the list of groups for a given word vk)
But it can be long (we don’t know how many there are in advance) and therefore we want a certain time after the script has run the script was cut down
Do this using bash, because ideally the script will then run for a longer time and I don’t want to change anything there
. Right now I run it like this:
python3 vkbot.py
How to write this script so that this script stops working after 15 minutes?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2019-12-15
@jcmvbkbc

man timeout
timeout -k 10 15m python3 vkbot.py

A
AVKor, 2019-12-14
@AVKor

sleep 900

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question