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
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.

  • Thanks simple but great anwser. – skowron-line Jun 11 '15 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.