By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 967 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

How to schedule script without cron?

P: n/a
Is there a way to get my script to run on regularly scheduled intervals
without using cron? My hosting provider sucks... cannot use cron... I was
thinking perhaps I could create a file every hour in a certain directory and
then fire the script when the file count reaches a certain number, and then
clear out the directory... or something like that. Any suggestions?

Thanks in advance.
Jul 17 '05 #1
Share this Question
Share on Google+
29 Replies


P: n/a

"deko" <no****@hotmail.com> wrote in message
news:gz*****************@newssvr25.news.prodigy.co m...
Is there a way to get my script to run on regularly scheduled intervals
without using cron? My hosting provider sucks... cannot use cron... I was thinking perhaps I could create a file every hour in a certain directory and then fire the script when the file count reaches a certain number, and then clear out the directory... or something like that. Any suggestions?

Thanks in advance.


You would need cron to create the file every hour unfortunately.

Maybe if one of your friends has a linux box you could get him to set a cron
job that point lynx at the script every so often, or else maybe leave a
browser window open on your machine with a window set to refresh every so
often (with meta refresh or whatever)
Jul 17 '05 #2

P: n/a
"deko" <no****@hotmail.com> wrote in
news:gz*****************@newssvr25.news.prodigy.co m:
Is there a way to get my script to run on regularly scheduled
intervals without using cron? My hosting provider sucks... cannot use
cron... I was thinking perhaps I could create a file every hour in a
certain directory and then fire the script when the file count reaches
a certain number, and then clear out the directory... or something
like that. Any suggestions?

Thanks in advance.


on your most visited webpage, use some server side code that checks the
time and if it falls withing your interval range, then run some code.
--
Edward Alfert
http://www.rootmode.com/
Multiple Domain Hosting and Reseller Hosting Plans
Coupon Code (Recurring $5/month Discount): newsgroup

Jul 17 '05 #3

P: n/a
> You would need cron to create the file every hour unfortunately.

yeah, I suppose that just begs the question.
Maybe if one of your friends has a linux box you could get him to set a cron job that point lynx at the script every so often, or else maybe leave a
browser window open on your machine with a window set to refresh every so
often (with meta refresh or whatever)


I have a few linux boxes. So I set up a cron to visit my hosted site? Not
sure what you mean...
Jul 17 '05 #4

P: n/a
> on your most visited webpage, use some server side code that checks the
time and if it falls withing your interval range, then run some code.


That sounds interesting. The key is keeping the schedule.

What I want to do is keep a count of page hits in a 24-hour period, 30-day
period, and 365-day period. I can assume there will always be at least one
hit in a 24-hour period.
Jul 17 '05 #5

P: n/a
deko wrote:
Is there a way to get my script to run on regularly scheduled intervals
without using cron? My hosting provider sucks... cannot use cron... I
was thinking perhaps I could create a file every hour in a certain
directory and then fire the script when the file count reaches a certain
number, and then
clear out the directory... or something like that. Any suggestions?

Thanks in advance.


Short answer:

user@host:~> nohup bash -c '
while true ; do
echo run your prog here
sleep 3600
done'

((((then ctrl-Z))))))
user@host:~> bg
user@host:~> exit
---------------------------
better answer:

read http://www.icon.co.za/~psheer/rute-home.html

C.
Jul 17 '05 #6

P: n/a
deko wrote:
Is there a way to get my script to run on regularly scheduled intervals
without using cron? My hosting provider sucks... cannot use cron... I was
thinking perhaps I could create a file every hour in a certain directory and
then fire the script when the file count reaches a certain number, and then
clear out the directory... or something like that. Any suggestions?

Thanks in advance.


create a "master" process, execute it in the background
$ ./timer &

that is in a loop:

loop
if nextinterval do something
wait until nextintervaltime
goto loop

unless you are able to have access to the system level, you are out of luck.
Any process not assoiciated with the server itself, would probably be detecteced
and killed. Do yourself a favor, spend a few extra bucks, get DSL or Cable at a
level that will allow you to run your own server (and use a hardware firewall).
This can be done using DynamicDNS (static IP not necessary). You will not be
able to use outbound SMTP because your IP address does not backtranslate, but
that is no big deal. I use DDNS for inbound POP SMTP and my ISP for outbound.
If your ISP has a history of lots of downtime during the day, then you may need
to look for something more stable.

If they reboot the system for maintenance or whatever, you will have to restart
your script. Use a box that you have control over... Trying to use ISP
"freebies" is really bad idea. Bottom line: if it is that important, get your
own system to work with... BTW, I have 2 Linux boxes and one OpenVMS box on the
net using DDNS (zoneedit.com)... All can do {L|V}AMP, but they also do a lot more :)

--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #7

P: n/a

"deko" <no****@hotmail.com> wrote in message
news:UJ*****************@newssvr25.news.prodigy.co m...
You would need cron to create the file every hour unfortunately.
yeah, I suppose that just begs the question.
Maybe if one of your friends has a linux box you could get him to set a

cron
job that point lynx at the script every so often, or else maybe leave a
browser window open on your machine with a window set to refresh every so often (with meta refresh or whatever)


I have a few linux boxes. So I set up a cron to visit my hosted site?

Not sure what you mean...


Right, Lets say your hosted site (domain.com) has a phpscript in /php/
called dorun.php that needs to be run every hour, every day add the
following line to your crontab

5 * * * 0-6 lynx http://www.domain.com/php/dorun.php

(I think that is correct, it's been a while since I have used cron)
Jul 17 '05 #8

P: n/a
> on your most visited webpage, use some server side code that checks the
time and if it falls withing your interval range, then run some code.


this is what the log looks like:

Jul 13 2004 06:30 pm|68.110.65.241|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:32 pm|68.127.69.101|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:34 pm|203.12.69.231|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:36 pm|64.122.69.141|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:38 pm|68.110.69.26|Windows 95|MSIE 5|pacbell.net

so if I can somehow analyze the date column...

if the bottom visit is less than [time() - 3600 * 24] then
move to the next line
else
run script

does this sound about right?
Jul 17 '05 #9

P: n/a
"deko" <no****@hotmail.com> wrote in
news:VN*****************@newssvr25.news.prodigy.co m:
on your most visited webpage, use some server side code that checks
the time and if it falls withing your interval range, then run some
code.


That sounds interesting. The key is keeping the schedule.

What I want to do is keep a count of page hits in a 24-hour period,
30-day period, and 365-day period. I can assume there will always be
at least one hit in a 24-hour period.


On every page load write the current date (not time) to a text file and
compare it to the previous line. If the date has changed, then count the
number of lines in the file (minus 1) and that is the number of hits the
previous day. Write this number to a different file including yesterday's
date and count.
--
Edward Alfert
http://www.rootmode.com/
Multiple Domain Hosting and Reseller Hosting Plans
Coupon Code (Recurring $5/month Discount): newsgroup

Jul 17 '05 #10

P: n/a
"deko" <no****@hotmail.com> wrote in news:uZaJc.10316$8Y.3454
@newssvr25.news.prodigy.com:
on your most visited webpage, use some server side code that checks the
time and if it falls withing your interval range, then run some code.


this is what the log looks like:

Jul 13 2004 06:30 pm|68.110.65.241|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:32 pm|68.127.69.101|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:34 pm|203.12.69.231|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:36 pm|64.122.69.141|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:38 pm|68.110.69.26|Windows 95|MSIE 5|pacbell.net

so if I can somehow analyze the date column...

if the bottom visit is less than [time() - 3600 * 24] then
move to the next line
else
run script

does this sound about right?


Doesn't your host provide analog, webalizer, awstats, or any of the other
free log analysys programs?

If not, does your hosting provide php and mysql?

Just log every visit to a mysql database and whenever you want to know
anything about your traffic pattern, query the database.

Select count(date) from visitors where date = dateyouwhattoknow;

You can create whatever sql statement you want. This is the way I would do
it.

--
Edward Alfert
http://www.rootmode.com/
Multiple Domain Hosting and Reseller Hosting Plans
Coupon Code (Recurring $5/month Discount): newsgroup

Jul 17 '05 #11

P: n/a
> create a "master" process, execute it in the background
$ ./timer &

that is in a loop:

loop
if nextinterval do something
wait until nextintervaltime
goto loop

unless you are able to have access to the system level, you are out of luck. Any process not assoiciated with the server itself, would probably be detecteced and killed. Do yourself a favor, spend a few extra bucks, get DSL or Cable at a level that will allow you to run your own server (and use a hardware firewall). This can be done using DynamicDNS (static IP not necessary). You will not be able to use outbound SMTP because your IP address does not backtranslate, but that is no big deal. I use DDNS for inbound POP SMTP and my ISP for outbound. If your ISP has a history of lots of downtime during the day, then you may need to look for something more stable.

If they reboot the system for maintenance or whatever, you will have to restart your script. Use a box that you have control over... Trying to use ISP
"freebies" is really bad idea. Bottom line: if it is that important, get your own system to work with... BTW, I have 2 Linux boxes and one OpenVMS box on the net using DDNS (zoneedit.com)... All can do {L|V}AMP, but they also do a

lot more :)

I was looking at DDNS a few weeks ago, but decided to go with a hosting
provider for portability purposes - that is, if I move, or change hosting
providers, my site is still up and email keeps coming. So uptime was
important, and also speed...

I do not have access to the server at my hosting provider, so, as you say,
I'm out of luck in terms of using a process-based schedule.
Jul 17 '05 #12

P: n/a
> user@host:~> nohup bash -c '
while true ; do
echo run your prog here
sleep 3600
done'


that is a good suggestion, but I think a file-based solution might be more
reliable - for example, what if the server gets rebooted or something.
Jul 17 '05 #13

P: n/a
> Right, Lets say your hosted site (domain.com) has a phpscript in /php/
called dorun.php that needs to be run every hour, every day add the
following line to your crontab

5 * * * 0-6 lynx http://www.domain.com/php/dorun.php


That sound like it would work, but then, potentially, anyone could kick off
my script. Is this correct? Also, forgive my ignorance, but what is lynx?
Jul 17 '05 #14

P: n/a
> On every page load write the current date (not time) to a text file and
compare it to the previous line. If the date has changed, then count the
number of lines in the file (minus 1) and that is the number of hits the
previous day. Write this number to a different file including yesterday's
date and count.


I have the counter script already written - but I want to update the figures
every three hours and maintain a rolling count. So, every three hours the
figures for each interval (24h, 30d, 365d) are updated. This would be easy
to do with cron, but alas, cron cannot be used...
Jul 17 '05 #15

P: n/a
> Doesn't your host provide analog, webalizer, awstats, or any of the other
free log analysys programs?
Yes, but this has a special purpose
If not, does your hosting provide php and mysql?


Yes, but I need a file-based solution

Jul 17 '05 #16

P: n/a
> > Jul 13 2004 06:30 pm|68.110.65.241|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:32 pm|68.127.69.101|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:34 pm|203.12.69.231|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:36 pm|64.122.69.141|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:38 pm|68.110.69.26|Windows 95|MSIE 5|pacbell.net

so if I can somehow analyze the date column...

if the bottom visit is less than [time() - 3600 * 24] then
move to the next line
else
run script

does this sound about right?


Is there a way to get file modification time in php? Perhaps I could just
check the mod date of a file with each visit.

For example, each time the site is visited, write something to a file.
Then, a separate script checks that file's mod date. If the mod date is 3
hours old, then run the script. Do you think this would work?
Jul 17 '05 #17

P: n/a

"deko" <no****@hotmail.com> wrote in message
news:E6*****************@newssvr25.news.prodigy.co m...
Right, Lets say your hosted site (domain.com) has a phpscript in /php/
called dorun.php that needs to be run every hour, every day add the
following line to your crontab

5 * * * 0-6 lynx http://www.domain.com/php/dorun.php
That sound like it would work, but then, potentially, anyone could kick

off my script. Is this correct? Also, forgive my ignorance, but what is lynx?


lynx is a text based browser that ships with most linux distros.

You could always put a clause in the script to only allow you to run it (For
example must have a certain password, or http authentication.) but otherwise
anyone could run it yes.
Jul 17 '05 #18

P: n/a
"deko" <no****@hotmail.com> wrote in
news:Ki****************@newssvr25.news.prodigy.com :
> Jul 13 2004 06:30 pm|68.110.65.241|Windows 95|MSIE 5|pacbell.net
> Jul 13 2004 06:32 pm|68.127.69.101|Windows 95|MSIE 5|pacbell.net
> Jul 13 2004 06:34 pm|203.12.69.231|Windows 95|MSIE 5|pacbell.net
> Jul 13 2004 06:36 pm|64.122.69.141|Windows 95|MSIE 5|pacbell.net
> Jul 13 2004 06:38 pm|68.110.69.26|Windows 95|MSIE 5|pacbell.net
>
> so if I can somehow analyze the date column...
>
> if the bottom visit is less than [time() - 3600 * 24] then
> move to the next line
> else
> run script
>
> does this sound about right?


Is there a way to get file modification time in php? Perhaps I could
just check the mod date of a file with each visit.

For example, each time the site is visited, write something to a file.
Then, a separate script checks that file's mod date. If the mod date
is 3 hours old, then run the script. Do you think this would work?


yes... take a look at user comments at
http://www.php.net/manual/en/function.fileatime.php
--
Edward Alfert
http://www.rootmode.com/
Multiple Domain Hosting and Reseller Hosting Plans
Coupon Code (Recurring $5/month Discount): newsgroup

Jul 17 '05 #19

P: n/a
> You could always put a clause in the script to only allow you to run it
(For
example must have a certain password, or http authentication.) but otherwise anyone could run it yes.


Perhaps I could check the modification date of a file with php and base my
scheduling on that. I could use lynx simply to visit the site at 12:00 each
day, which would create a benchmark file. Then my script checks the mod
date of that file... woudl this work? How to check the mod date of a file
with php?

I would like to know more abotu using lynx and authentication - for example,
can I automate a login to my bank's online banking page to get my bank
balance each day? Of course, that site uses encription and probally a bunch
of other security I don't understand...

Jul 17 '05 #20

P: n/a
> > Is there a way to get file modification time in php? Perhaps I could
just check the mod date of a file with each visit.

For example, each time the site is visited, write something to a file.
Then, a separate script checks that file's mod date. If the mod date
is 3 hours old, then run the script. Do you think this would work?


yes... take a look at user comments at
http://www.php.net/manual/en/function.fileatime.php


I think that's the answer... Thanks!!
Jul 17 '05 #21

P: n/a

"deko" <no****@hotmail.com> wrote in message
news:nx******************@newssvr25.news.prodigy.c om...
You could always put a clause in the script to only allow you to run it (For
example must have a certain password, or http authentication.) but

otherwise
anyone could run it yes.


Perhaps I could check the modification date of a file with php and base my
scheduling on that. I could use lynx simply to visit the site at 12:00

each day, which would create a benchmark file. Then my script checks the mod
date of that file... woudl this work? How to check the mod date of a file
with php?
http://ie2.php.net/manual/en/function.filemtime.php


I would like to know more abotu using lynx and authentication - for example, can I automate a login to my bank's online banking page to get my bank
balance each day? Of course, that site uses encription and probally a bunch of other security I don't understand...


I don't know about your bank, but mine uses java, activex, javascript and a
bunch of other crap lynx can not support, so I would not be able to get past
the login screen.

HTTP Authentication on the other hand is achieved through .htaccess and
..htpasswd (Or it can be done through PHP too)

A page using HTTP Authentication can be accessed in the following manner.

http://user:pa******@domain.com

Thus allowing it to be easily accessed from a browser launched via cron
while also giving it some measure of security.
HTTP AUTHENTICATION IN PHP (This will only work on apache afaik)

<?php

if ((!isset($PHP_AUTH_USER) || $PHP_AUTH_USER != "USERNAME") &&
(!isset($PHP_AUTH_PW) || $PHP_AUTH_PW != "ABERDEEN")) {
header("WWW-Authenticate: Basic realm=\"cronexample\"");
Header("HTTP/1.0 401 Unauthorized");
echo "<html><body bgcolor=efefef>";
echo "You must have a username and password to access this site.";
exit;
}
else if(($PHP_AUTH_USER=="USERNAME") && ($PHP_AUTH_PW=="PASSWORD"))
{
$cookiename = "auth";
$cookievalue = "ok";
$cookieexpire = time()+9200;
$cookiedomain = "";
setcookie($cookiename, $cookievalue, $cookieexpire, "/", $cookiedomain,
0);
}
?>

And you can do your file stuff here.
Jul 17 '05 #22

P: n/a
deko wrote:
create a "master" process, execute it in the background
$ ./timer &

that is in a loop:

loop
if nextinterval do something
wait until nextintervaltime
goto loop

unless you are able to have access to the system level, you are out of


luck.
Any process not assoiciated with the server itself, would probably be


detecteced
and killed. Do yourself a favor, spend a few extra bucks, get DSL or


Cable at a
level that will allow you to run your own server (and use a hardware


firewall).
This can be done using DynamicDNS (static IP not necessary). You will


not be
able to use outbound SMTP because your IP address does not backtranslate,


but
that is no big deal. I use DDNS for inbound POP SMTP and my ISP for


outbound.
If your ISP has a history of lots of downtime during the day, then you may


need
to look for something more stable.

If they reboot the system for maintenance or whatever, you will have to


restart
your script. Use a box that you have control over... Trying to use ISP
"freebies" is really bad idea. Bottom line: if it is that important, get


your
own system to work with... BTW, I have 2 Linux boxes and one OpenVMS box


on the
net using DDNS (zoneedit.com)... All can do {L|V}AMP, but they also do a


lot more :)

I was looking at DDNS a few weeks ago, but decided to go with a hosting
provider for portability purposes - that is, if I move, or change hosting
providers, my site is still up and email keeps coming. So uptime was
important, and also speed...

I do not have access to the server at my hosting provider, so, as you say,
I'm out of luck in terms of using a process-based schedule.


Unless it takes you more than 48 hours to move and get your new connection set
up, that shouldn't be a problem. I used ZoneEdits email "store-and-forward" as
a backup mail server. The mail just collected there while I moved from NC to
KC. The server was down for about 7-10 days - no email was missed... took a
while to read through them...

If you change providers you also may have to change registrars for your domain
name(some force the change - which is really stupid, but whatever...) When this
occurs, it takes 2-3 days for the new information to be propogated. So, using
DynDNS and registering the domain name yourself where you have control over the
technical information such as primary DNS etc... then it is actually a lot
better than trying to play by the minimalist rules of ISP-based hosting. You
have to play by their rules and applications.

--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #23

P: n/a
> I don't know about your bank, but mine uses java, activex, javascript and
a
bunch of other crap lynx can not support, so I would not be able to get past the login screen.

HTTP Authentication on the other hand is achieved through .htaccess and
.htpasswd (Or it can be done through PHP too)

A page using HTTP Authentication can be accessed in the following manner.

http://user:pa******@domain.com

Thus allowing it to be easily accessed from a browser launched via cron
while also giving it some measure of security.
HTTP AUTHENTICATION IN PHP (This will only work on apache afaik)

<?php

if ((!isset($PHP_AUTH_USER) || $PHP_AUTH_USER != "USERNAME") &&
(!isset($PHP_AUTH_PW) || $PHP_AUTH_PW != "ABERDEEN")) {
header("WWW-Authenticate: Basic realm=\"cronexample\"");
Header("HTTP/1.0 401 Unauthorized");
echo "<html><body bgcolor=efefef>";
echo "You must have a username and password to access this site.";
exit;
}
else if(($PHP_AUTH_USER=="USERNAME") && ($PHP_AUTH_PW=="PASSWORD"))
{
$cookiename = "auth";
$cookievalue = "ok";
$cookieexpire = time()+9200;
$cookiedomain = "";
setcookie($cookiename, $cookievalue, $cookieexpire, "/", $cookiedomain,
0);
}
?>

And you can do your file stuff here.

cool... I will play around with this. Thanks.
Jul 17 '05 #24

P: n/a
> Unless it takes you more than 48 hours to move and get your new connection
set
up, that shouldn't be a problem. I used ZoneEdits email "store-and-forward" as a backup mail server. The mail just collected there while I moved from NC to KC. The server was down for about 7-10 days - no email was missed... took a while to read through them...

If you change providers you also may have to change registrars for your domain name(some force the change - which is really stupid, but whatever...) When this occurs, it takes 2-3 days for the new information to be propogated. So, using DynDNS and registering the domain name yourself where you have control over the technical information such as primary DNS etc... then it is actually a lot
better than trying to play by the minimalist rules of ISP-based hosting. You have to play by their rules and applications.


I've already purchased a year of hosting, so I'll be using that for now -
but would like to set up another site with DDNS... I've got enough linux
boxes in teh garage... might as well put them onthe air... How do I get
started? Can you point me to a site that shows me how?
Jul 17 '05 #25

P: n/a
In article <gz*****************@newssvr25.news.prodigy.com> , deko wrote:
Is there a way to get my script to run on regularly scheduled intervals
without using cron? My hosting provider sucks... cannot use cron... I was
thinking perhaps I could create a file every hour in a certain directory and
then fire the script when the file count reaches a certain number, and then
clear out the directory... or something like that. Any suggestions?


You could look in the archives of this group. Question has been asked
many times before.

--
Tim Van Wassenhove <http://home.mysth.be/~timvw>
Jul 17 '05 #26

P: n/a
deko wrote:
on your most visited webpage, use some server side code that checks
the time and if it falls withing your interval range, then run some
code.


this is what the log looks like:

Jul 13 2004 06:30 pm|68.110.65.241|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:32 pm|68.127.69.101|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:34 pm|203.12.69.231|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:36 pm|64.122.69.141|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:38 pm|68.110.69.26|Windows 95|MSIE 5|pacbell.net

so if I can somehow analyze the date column...

if the bottom visit is less than [time() - 3600 * 24] then
move to the next line
else
run script

does this sound about right?


Would it not be easier to use the time () function ? (returns seconds passed
since 1-1-1970)
Simply write it to a file the first time.
Every next run compare time () to the stored version. If the difference in
seconds becomes larger than your desired interval, do your stuff and rewrite
the file with the new timestamp.
Pjotr
Jul 17 '05 #27

P: n/a
deko wrote:
Unless it takes you more than 48 hours to move and get your new connection


set
up, that shouldn't be a problem. I used ZoneEdits email


"store-and-forward" as
a backup mail server. The mail just collected there while I moved from NC


to
KC. The server was down for about 7-10 days - no email was missed... took


a
while to read through them...

If you change providers you also may have to change registrars for your


domain
name(some force the change - which is really stupid, but whatever...) When


this
occurs, it takes 2-3 days for the new information to be propogated. So,


using
DynDNS and registering the domain name yourself where you have control


over the
technical information such as primary DNS etc... then it is actually a lot
better than trying to play by the minimalist rules of ISP-based hosting.


You
have to play by their rules and applications.

I've already purchased a year of hosting, so I'll be using that for now -
but would like to set up another site with DDNS... I've got enough linux
boxes in teh garage... might as well put them onthe air... How do I get
started? Can you point me to a site that shows me how?


All you need is a router that can support port-forwarding. In fact, there are
tons of examples (google for linux broadband router) should get you started.

you can start at http://www.firstdbasource.com/ and click on "how do I put
openvms on broadband" you will have to make the appropriate technology
translations, but shouldn't be that difficult.

--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #28

P: n/a
> All you need is a router that can support port-forwarding. In fact, there
are
tons of examples (google for linux broadband router) should get you started.
you can start at http://www.firstdbasource.com/ and click on "how do I put
openvms on broadband" you will have to make the appropriate technology
translations, but shouldn't be that difficult.


Sounds interesteing - I'll take a look.

As for reworking my script to run without cron, I think I've got an idea....

Here is what the file looks like that contains a record of site visits:

Jul 14 2004 09:30 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089822637
Jul 14 2004 09:30 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089822644
Jul 14 2004 09:31 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089822679
Jul 14 2004 09:31 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089822686
Jul 14 2004 09:47 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089823630
Jul 14 2004 09:47 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089823638
Jul 14 2004 11:09 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089828547
Jul 14 2004 11:09 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089828553
Jul 14 2004 11:16 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089829014
Jul 14 2004 11:16 am|68.122.69.241|Windows Server|MSIE
6|pacbell.net|1089829019

The last column is time()

So, if I can count the number of lines in this file that are within the the
intervals in question, I'll have the count for each interval:

number of entries > time() - (3600*24) = $hr24
number of entries > time() - (3600*24*30) = $d30
number of entries > time() - (3600*24*365) = $d365

But how do I count lines in a file?

Jul 17 '05 #29

P: n/a
"deko" <no****@hotmail.com> wrote in message news:<gz*****************@newssvr25.news.prodigy.c om>...
Is there a way to get my script to run on regularly scheduled intervals
without using cron? My hosting provider sucks... cannot use cron... I was
thinking perhaps I could create a file every hour in a certain directory and
then fire the script when the file count reaches a certain number, and then
clear out the directory... or something like that. Any suggestions?


1. Fakecron
a. using PHP include/require
b. using webbug
2. 3rd party remote cron <http://hostedcron.com/>

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #30

This discussion thread is closed

Replies have been disabled for this discussion.