Skip to content

How to run bash script in the background

Daisho Komiyama edited this page Apr 12, 2023 · 2 revisions

Problem

I want to keep the GitHub actions runner idle (running), but it stops every time I close the SSH session.

Solution

When you run run.sh, append an ampersand &.

./run.sh &

That's it.

Update

The above code didn't work, but the below worked. Use nohup.

nohup ./run.sh &
Clone this wiki locally