开发者

How can i make a code run automatically every 30 mins in shell script or PHP?

开发者 https://www.devze.com 2023-03-10 00:50 出处:网络
I have a code which I want to run every 30mins. Since it is not possible to do it manually over 30 days I wanted to make it an automated process. Please suggest me how to do it. I want to execute this

I have a code which I want to run every 30mins. Since it is not possible to do it manually over 30 days I wanted to make it an automated process. Please suggest me how to do it. I want to execute this command in Putty.

--user root --host 10.0.2.140 --port 3306 --socket /var/lib/mysql/mysql.sock 开发者_Python百科


Use crontab, your entry would look like this:

*/30 * * * * /path/to/your/command


Unix and derivatives use Cron Jobs

http://en.wikipedia.org/wiki/Cron

Windows uses scheduled tasks.

https://superuser.com/questions/85297/how-to-schedule-a-task-in-windows-7

Note that there are also some Cron clone implementations for windows available if you prefer.

0

精彩评论

暂无评论...
验证码 换一张
取 消