scheduling a php page to run every hour....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

The duration is merely how long you expect the task to run...

So, if a program is gonna take an hour to run, then it has to force you to set the next scheduled task to be 1 minute after.. this is due to the fact that if a task is running when another task comes into play, then you are gonna get a blue screen of death..

So, even though you set it for another minute, this tells task scheduler that it's not going to repeat during the 1 hour period. you could even go so far as to check the "kill this task if it's still running" (or something like that) box and ensure that the previous task is over when the new one starts.

hope this helps/makes sense.

Edit :

SP, that does exactly what task manager does... only you are writing it out instead of just assigning it through the gui..
rsmarsha
Forum Contributor
Posts: 242
Joined: Tue Feb 08, 2005 4:06 am
Location: Leeds, England

Post by rsmarsha »

I've set up cron jobs to backup a databases, but i'm having trouble getting a file to run

i'm using this atm:

* * * * * rem_credit_check.php

It doesn't seem to be working, i'm running it on my host webserver in the home dir.
rsmarsha
Forum Contributor
Posts: 242
Joined: Tue Feb 08, 2005 4:06 am
Location: Leeds, England

Post by rsmarsha »

It seems that as my php is complied as cgi need something like this in my script:

#!/usr/local/bin/php -q

Also do i need the full path with domain or server path to file?

I seem to have got it to run with GET http://fullpath/file.php

how do i make it email a result to me and set the address?
rsmarsha
Forum Contributor
Posts: 242
Joined: Tue Feb 08, 2005 4:06 am
Location: Leeds, England

Post by rsmarsha »

I managed to get it to mail me by using the php mail() function in the script itself, but is there a way to get it to send all the results direct from the server when the CRON job runs?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

i use this for Windows cron tasks
http://www.splinterware.com/products/wincron.htm
Post Reply