I'm having a user control panel (UCP) for my game server.
I offer different memberships (gold/silver/bronze etc) for money.
However, I want to run a PHP script every 24 hours, to run a check over the "users" database and see if 30 days have elapsed. I know how to create the function but I don't know how to make it work automatically. My host is using Windows Server 2008 R2.
Asked
Active
Viewed 394 times
1

CSᵠ
- 10,049
- 9
- 41
- 64

Ariel Weinberger
- 2,195
- 4
- 23
- 49
-
2Use the Task Scheduler to schedule the script running. [Related question](http://stackoverflow.com/questions/850556/how-to-emulate-cron-jobs-on-a-windows-server) – Niet the Dark Absol Jan 01 '13 at 18:39
-
I've heard about the Task Scheduler. Can you explain a bit more? – Ariel Weinberger Jan 01 '13 at 18:48
1 Answers
2
Linux / Unix / OS X
Scheduled jobs are call cron jobs under linux.
Configuring cronjobs usually requires you to use the shell (over SSH). Sometimes a hosting provider might provide to schedule jobs through their control panel.
Here's are great article about how to add a cronjob.
Windows
Under windows, you can use the task schedular to execute a job periodically. Read this howto for that.

Arnold Daniels
- 16,516
- 4
- 53
- 82
-
This is always my preferred approach. It works well because you can specify down to the minute granularity in running the script. Just make sure you have similar granularity in the membership expiration times. – CaseySoftware Jan 01 '13 at 18:57