Run a script automatically - without using CRON

Asked

Viewed 1,112 times

3

I usually schedule a script that should be run from time to time (such as an order status update, for example) using Linux CRON. (I have no idea how to do this on Windows hosts)

However, I noticed that Wordpress seems to do this without the use of CRON, as it updates itself automatically when the Owner of your installation has access to it. But I didn’t find in his code how he does it.

Detail, this update works independent of the OS used (even in windows).

How, then, to create a System that runs automatically?

Applying: Automatic app updater, order status updater, file backups creator, and more.

  • what wp does is when someone accesses the application he checks the schedule and executes what is needed, just like cron in windows we have the task scheduler that can be used for this.

  • Thanks @Otto for the reply. I thought it was something like this, but note that wordpress updates even when your admin is not accessed. Or does it run tb Software when the blog is accessed? It would not impact performance?

  • The listner is when the blog is accessed, I will convert my comment in response, since it helped you

  • you want to do this within wordpress?

  • Not @Caiofelipepereira. I used WP as an example. I have my own PHP scripts. But apparently, what he does is he runs the programmed script when someone accesses the blog. At least that’s what Otto reported. Let’s see if anyone can find a different method.

  • @Szag-Ot, that’s exactly what he does anyway

Show 1 more comment

1 answer

2


What wp does is when someone accesses the application he checks the schedule and executes what is needed, just like cron in windows we have the task scheduler that can be used for this.

The listner is when the blog is accessed, because I have some blogs with weekly scheduling and not access daily, but your posts are always being made.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.