Thursday, November 14, 2019

Run Script in Screen Mode on Startup

Description: Here I have explained, How to run script on Startup

Procedure: 
  • Create one script as below which will run in screen mode

 #!/bin/sh
screen -d -m -S SessionName /home/script/run.sh

  • To run script on startup open crontab and define schedule as follow.
 @reboot /bin/sh /home/script/run.sh 

  • After define in schedule restart crontab service and test by restart server.

No comments:

Post a Comment