Setting up a cron job with Webmin

后端 未结 5 1020
后悔当初
后悔当初 2021-02-04 14:44

I am trying to setup a Cron job using Webmin to run every 5 min. It needs to target a .php file and run the php script in that file. When I enter the path to the file in the \

5条回答
  •  再見小時候
    2021-02-04 15:22

    im guessing you are running a linux environment. in that case you can run the command (through ssh/terminal) php /path/to/file.php.

    If this works, then now the trick is to make this a scheduled command. You can do this with crontab by typing crontab -e This will then open a text editor which you can type something of the following:

    @hourly php /path/to/file.php >/dev/null 2>&1
    

    This will then run the command php /path/to/file.php every hour and detatch the process.

    This is the linux way of doing it, webmin may have a way of doing this through the web ui. maybe that is what you are asking?

提交回复
热议问题