How to run a shell script at startup

前端 未结 21 2027
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 13:39

On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my

21条回答
  •  没有蜡笔的小新
    2020-11-22 14:08

    Just have a line added to your crontab..

    Make sure the file is executable:

    chmod +x /path_to_you_file/your_file
    

    To edit crontab file:

    crontab -e
    

    Line you have to add:

    @reboot  /path_to_you_file/your_file
    

    That simple!

提交回复
热议问题