473,785 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to schedule script without cron?

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
29 11279

"deko" <no****@hotmail .com> wrote in message
news:gz******** *********@newss vr25.news.prodi gy.com...
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
"deko" <no****@hotmail .com> wrote in
news:gz******** *********@newss vr25.news.prodi gy.com:
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
> 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
> 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
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
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 nextintervaltim e
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

"deko" <no****@hotmail .com> wrote in message
news:UJ******** *********@newss vr25.news.prodi gy.com...
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
> 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.24 1|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:32 pm|68.127.69.10 1|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:34 pm|203.12.69.23 1|Windows 95|MSIE 5|pacbell.net
Jul 13 2004 06:36 pm|64.122.69.14 1|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
"deko" <no****@hotmail .com> wrote in
news:VN******** *********@newss vr25.news.prodi gy.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.


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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9456
by: Timo-Pekka Oikarinen | last post by:
Is there PHP chat script *without* MySQL? Demands: absolutely FREE (no adware, shareware etc.), No MySQL needed, one permanent public chat, can make your own channels (public/private) like IRC, several admins (one superadmin, me ;-D ), bad word filter, user nick ban/ip ban/kick (temporary/permanent), small file sharing and @time script ( http://www.swatch.com/internettime/home.php ) to upper right corner. Environment: Windows 2000 Pro...
5
9204
by: deko | last post by:
In regard to running php scripts with cron - Here is a sample script: <?php //debug.php echo "<br> This is a test"; ?> I can call debug.php from a web page on my site like this:
2
2486
by: erikcw | last post by:
Hi all, When trying to run this python script from cron, I get the following error: Traceback (most recent call last): File "/home/lybp/public_html/wa/wa.py", line 14, in ? import MySQLdb ImportError: No module named MySQLdb
1
3284
by: vaskarbasak | last post by:
Hi All, how will i set shell script on cron tab to execute the script? please help me. Thanks! Vaskar
2
3252
by: smitanaik | last post by:
i have a java file which i am running through shell script. the syntax that i have used is #! /bin/bash javac Copy.java
1
1593
by: djpaul | last post by:
Hello, I am just a newbie to javascript, but the most stuff i do is in php or .net. But, now i have 2 buttons on my script that are calling a javascript function as shown below (OnClick""). Now after a person pushes 1 of the 2 buttons, i want to send some information to a php-file to update my database. The only thing that the customer will see is a message from the alert( "Thanks"); for example. This is what i did now: <script...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.