Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to run program in background using Byobu

📅 2014-Sep-29 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ background, byobu, tmux ⬩ 📚 Archive

When running a training program, that might take hours to complete, I like to run it in the background. However, it should keep running even if I kill my current shell. I should be able to bring it back to the foreground and check its console output and then send it back to background. I should be able to do this any number of times.

The solution that fulfilled these requirements was to run the program in a new Byobu session. This is how I do it:

$ byobu
$ ./my-program

The advantage of this setup is that Byobu is not the child of my shell, but rather of the desktop lightdm process. So, it will keep running even if my terminal is hung or killed. It also enables me to see the console output of the program anytime I want.

Tried with: Byobu 5.74, TMux 1.8 and Ubuntu 14.04


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧