Jump to content


Photo

Setting up a scheduled task to run a PHP file


  • Please log in to reply
1 reply to this topic

#1 netfrugal

netfrugal
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 13 October 2006 - 07:35 PM

I would like to run a simple php file that backs up my database.  The file is in one of the virtual directories. 

I know I can do it with other ways, but I'm interested in how to do it on a windows OS, and using the windows scheduled tasks wizard - if possible.

I've read that parameters need to be set up, but I don't quite understand what that means.

Does anyone know how I can do this in a simple step by step fashion?

thanks!

#2 netfrugal

netfrugal
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 13 October 2006 - 08:42 PM

Got it figured out!

The best way to do this is to create a batch file that includes php.exe and the php file that needs to be executed:

C:\php\php.exe C:\apache2\htdocs\emailscript.php

then I set up the scheduled task to run the .bat file when I need it.

Next thing to figure out is how to set up a cron job on linux to do the same thing.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users