I have a screen named 'foo' that I started using the command
screen -S foo -d -m my_command_goes_here.I want to put this in cron, and restart it nightly by killing the screen. The reason I'm using a screen is my command starts up several other procs and this will ensure they all exit.
So... what is the command to kill sceen 'foo'?
Thanks!
12 Answers
screen -S foo -X quit
From the man page:
-X Send the specified command to a running screen session.
...
quit Kill all windows and terminate screen. Try using this:
screen -S foo -X kill
I would be cautious tho, depending on what you're running and the state that it's in, this may not kill the processes running in screen, and maybe cause file system instability if it has any files open (i don't know for sure, i'm just assuming)
3