How to cleanly end a process started by at?
Colin Watson
cjwatson at ubuntu.com
Tue Dec 8 12:18:30 UTC 2020
On Tue, Dec 08, 2020 at 12:12:30PM +0100, Bo Berglund wrote:
> When I run youtube-dl interactively and it is busy downloading (at
> that time it is actually ffmpeg running) I can use the keyboard Ctrl-C
> to stop the process and this makes the download stop cleanly leaving a
> valid mp4 file. So it cleans up the file then exits.
>
> I have tried using the timeout function in Linux, but that seems to
> force kill the process including child processes all the way down to
> ffmpeg. So it leaves the file.mp4.part file rather than cleaning up...
>
> Is there any way to simulate whatever happens when I hit Ctrl-C on the
> keyboard when my script is running interactively in a terminal
> session?
Ctrl-C sends the SIGINT signal, so "timeout --signal=INT 1h ..." should
do what you want.
--
Colin Watson (he/him) [cjwatson at ubuntu.com]
More information about the ubuntu-users
mailing list