I am using youtube-dl to download an entire playlist of videos. I would like to do this overnight as the videos are quite long. The first video continues to download after being disowned, but the program stops when it should download the second one, in fact, it doesn’t even finish the first one completely.

Is there a special way to disown and background this? Currently I am using (mid-download) Ctrl+Z, disown %1, bg, and logout.

I am using a Raspberry Pi 4B 4GB on Ubuntu Server 19.10, which is why I am posting on here instead of Unix SE.

I will answer any questions in the comments.

  • 1
    Could you use screen or tmux? Have you tried the nohup command?
    – user115418
    Apr 5, 2020 at 18:13
  • You could use setsid for this, but (slightly steeper learning curve, much better reward) is to use tmux. See raspberrypi.stackexchange.com/a/100590/5538 and raspberrypi.stackexchange.com/a/107032/5538 The second one is closer to your use case as it is about running system updates in the background.
    – goldilocks
    Apr 5, 2020 at 18:56
  • @Andyroo I haven’t considered Screen, but I’ll try it out. Apr 6, 2020 at 0:22
  • I'm not sure there's enough information in your question to provide a specific answer, but wrt disown, here's a resource. I'm not terribly familiar w/ youtube-dl, but can you not just run the entire process in the background; i.e. youtube-dl (args & opts) &?
    – Seamus
    Apr 7, 2020 at 10:04


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.