0

I am developing an application on Linux CentOS server. I need to automatically after registration of each use server create a screen to run some codes in loop for user.

When I use bash script to create new screen, it can't open screen and run commands in that screen.

For example, I want to open an screen and I run a php file in that screen. I have created a bash script test.sh but when I run this using cron tab it doesn't work.

screen
php php.php

Please tell what can I do to solve this?

3
  • Why are you tagging this by cron? There is nothing related to cron in your question, and I hope very much that you are not going to start screen as a cron-job. Commented Dec 4, 2019 at 14:19
  • Because I am running bash script using crontab Commented Dec 5, 2019 at 10:38
  • But you can't start a screen session from a crontab! You don't have a terminal! Commented Dec 6, 2019 at 7:49

1 Answer 1

2

It's quite easy to do this and such a thread already exists.

screen -d -m yourcommand
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.