Skip to content

Instantly share code, notes, and snippets.

@apotox
Created January 20, 2020 14:19
Show Gist options
  • Save apotox/5a81801075a758af45d58e479e4b3fc6 to your computer and use it in GitHub Desktop.
Save apotox/5a81801075a758af45d58e479e4b3fc6 to your computer and use it in GitHub Desktop.
restart a Linux process in a background Screen.
#restart a process in a background Screen.
ps aux | awk '/process_filename/ {print}' | awk '{print $2}' | xargs kill -SIGTERM
echo "restarting process_filename.."
screen -r <screen_id> -X stuff $"/path/to/process_filename -params=123\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment