View Full Version : Cron Jobs
08-28-2003, 01:07 AM
I wasn't entirely sure where to post this so I posted here.
I was wondering if it's possible to use Cron Jobs to open a specified page once a week?
If the page resides on your own hosted server would that be a problem? (Logically thinking that would be easiest)
The page can open and then close after a few seconds.
I've searched around a bit and found certain texts saying how to set up a Cron Job, but nothing explaining what you can actually do with them.
If there is no way to accomplish this via Cron Jobs, does anyone know any other way.
08-28-2003, 01:20 AM
This is the correct forum for this question.
You might need to elaborate on what you mean by opening a page. What kind of page?
08-29-2003, 02:38 AM
Just any page
Say i wanted to open http://www.codingforums.com/
Would that be possible and then for it to close again after a set time period.
08-29-2003, 04:11 AM
That doesn't make any sense. Open it and do what? If this is running on a web host server which it would be and on a Linux server since you said CRON jobs then opening a file does not mean opening it in the sense that you would open it in a web browser.
What is it that you are trying to achieve?
08-29-2003, 02:10 PM
I'll take that as a no then.
What I am trying to achieve is posted above.
(Open/execute a page or a script that opens a page and then closes itself after a set time period)
Say you had a .php script for logging into an ftp and uploading/downloading a text file. Would you be able to automate that process?
If so would it be much harder to open a web page from a server. I know its port 21 & port 80 with two totally different methods.
08-29-2003, 02:38 PM
You can run scripts using CRON jobs for running queries on databases, you can run scripts to perform various different tasks to files etc.
But when you say opening a website for a few seconds and then closing it doesn't make any sense at all.
Maybe the question should be why do you need to open a website for a few seconds and then close it?
08-30-2003, 02:15 PM
Crons run scripts. For instance -
A cron does something like this ::
Run delete.php at 4:30 AM Everyday
And delete.php might empty a table in the datbase or something like that
09-02-2003, 02:32 AM
I managed to figure it out:D
My Cron job is (runs weekly)
lynx -dump http://www.sitename/cron/test.php
Then the php, which i don't fully understand but it works.
$fp = fopen("http://www.whatever.com/", "r") or die("OPEN");
while (! feof($fp))
fread($fp, 1024) or die("READ");
fclose($fp) or die("CLOSE");
It leaves the file in my web root so now i just have to set up another to delete that.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.