0

How can I check if command running in screen is still running or it output with exception ?? So I can report it to user.

Im trying to execute command which is inserting data to mysql but from time to time Im getting

[PDOException]
  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
  • Re-attach to the session and check? Are you trying to find the output of a command running in screen via a script? – Wesley Jun 10 '15 at 20:53

1 Answers1

2

screen can output logs with the -L option. Within an already existing screen session you can Ctrl-a H to turn it on. From there, you could conceivably tail the screen logs and parse it for various conditions that you're interested in.

Wesley
  • 32,690
  • 9
  • 82
  • 117