简体   繁体   中英

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

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 

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM