Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how execute an script from server every 30 seconds - apache [duplicate]

how can I execute a php script from server every 30 seconds?

I have a php script and I need to execute it every 30 seconds to retrieve some information from other sites by curl.

but I dont know to run a php page in background by apache every 30 seconds.

like image 263
Hamidreza shaabani Avatar asked Jul 12 '26 09:07

Hamidreza shaabani


1 Answers

Use Cron job script. Get a 30 seconds interval , you could delay by 30 seconds:

-*/5-22 * * * sleep 30;your_script.php

The above script will run 5am to 10 pm

like image 78
Sudhanshu Saxena Avatar answered Jul 17 '26 16:07

Sudhanshu Saxena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!