Running a command as a background process/service

前端 未结 5 1969
猫巷女王i
猫巷女王i 2021-02-13 03:27

I have a Shell command that I\'d like to run in the background and I\'ve read that this can be done by suffixing an & to the command which causes it to run as a

5条回答
  •  醉梦人生
    2021-02-13 04:09

    Take a look at the daemon command, which can turn arbitrary processes into daemons. This will allow your script to act as a daemon without requiring you to do a lot of extra work. The next step is to invoke it automatically at boot. To know the correct way to do that, you'll need to provide your OS (or, for Linux, your distribution).

提交回复
热议问题