473,394 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Automated Server Scripts at Intervals

Our company has developed a web-app that needs the ability to run a
regular maintenance PHP script and use it also send out SMS/Email
alerts on a regular basis, say at exactly 9AM and 2PM without user
interaction. We're using shared hosting at the moment, so we have no
access anything more than our file directory on the server and our
database. To resolve this I've created a small vb.net app that accesses
the maintenance script on our server at the preset times, which sends
out the email and everything as it should. This is functional for now
but I see this as a short-term solution considering the possible
unreliability of running an app outside of the server on a home/office
computer, also the possible security risks involved. I was wondering if
anyone knew of a better solution. We're going to be upgrading to a
dedicated server within a few months and surely there is a way for the
server to automatically run a php script at regular intervals? Maybe
I'm just looking for the most difficult solution, but any help would be
appreciated.

Mar 3 '06 #1
7 2281
NC
enko wrote:

Our company has developed a web-app that needs the ability to run a
regular maintenance PHP script and use it also send out SMS/Email
alerts on a regular basis, say at exactly 9AM and 2PM without user
interaction. We're using shared hosting at the moment, so we have no
access anything more than our file directory on the server and our
database. To resolve this I've created a small vb.net app that accesses
the maintenance script on our server at the preset times, which sends
out the email and everything as it should. This is functional for now
but I see this as a short-term solution considering the possible
unreliability of running an app outside of the server on a home/office
computer, also the possible security risks involved. I was wondering if
anyone knew of a better solution. We're going to be upgrading to a
dedicated server within a few months and surely there is a way for the
server to automatically run a php script at regular intervals?


Since you are upgrading to a dedicated server, I think the problem is
not worth solving now. Just make sure you take appropriate precautions
against accidentally running the maintenance script too often (have the
script keep a log of its activity and do nothing unless it's time for
the next run).

Also, when you do upgrade, it's probably a good idea to run your script
from the command line...

Cheers,
NC

Mar 3 '06 #2

"enko" <mb*******@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
We're going to be upgrading to a
dedicated server within a few months and surely there is a way for the
server to automatically run a php script at regular intervals? Maybe
I'm just looking for the most difficult solution, but any help would be
appreciated.


Once you've got your dedicated server, the daemon you want it called crond
if it's
Linux, or the Task Scheduler if it's Windows. Either way, you need to call
'php myscript.php'.
However, make sure your script doesn't expect to use Apache/IIS-specific
stuff, or
PHP will bail out.

If you speak very nicely with your hosts, they might set this up for you
temporarily now,
on the grounds that you're going to upgrade to a dedicated server soon
anyway.

Jon
Mar 3 '06 #3
d
"Jonathan Wiltshire" <ne**@jwiltshire.org.uk> wrote in message
news:AS*******************@newsfe5-gui.ntli.net...

"enko" <mb*******@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
We're going to be upgrading to a
dedicated server within a few months and surely there is a way for the
server to automatically run a php script at regular intervals? Maybe
I'm just looking for the most difficult solution, but any help would be
appreciated.
Once you've got your dedicated server, the daemon you want it called crond
if it's
Linux, or the Task Scheduler if it's Windows. Either way, you need to call
'php myscript.php'.
However, make sure your script doesn't expect to use Apache/IIS-specific
stuff, or
PHP will bail out.

If you speak very nicely with your hosts, they might set this up for you
temporarily now,
on the grounds that you're going to upgrade to a dedicated server soon
anyway.


Provided the new server is with them :-P
Jon

Mar 3 '06 #4

"d" <d@example.com> wrote in message
news:Dl******************@text.news.blueyonder.co. uk...

Provided the new server is with them :-P


Well, yeh, there is that.. ;-)
Mar 3 '06 #5
On Fri, 03 Mar 2006 21:15:15 +0000, d wrote:
We're going to be upgrading to a
dedicated server within a few months and surely there is a way for the
server to automatically run a php script at regular intervals? Maybe
I'm just looking for the most difficult solution, but any help would be
appreciated.


Once you've got your dedicated server, the daemon you want it called
crond if it's
Linux, or the Task Scheduler if it's Windows. Either way, you need to
call 'php myscript.php'.
However, make sure your script doesn't expect to use Apache/IIS-specific
stuff, or
PHP will bail out.

If you speak very nicely with your hosts, they might set this up for you
temporarily now,
on the grounds that you're going to upgrade to a dedicated server soon
anyway.


Provided the new server is with them :-P


But most hosts would do it now on the fact the client says "we're going to
be going dedicated in 3 months and will be considering your company for
that, in the meantime would you....."

It may help if you get a sexy-sounding lady to call for you :-)

Cheers,
Andy
--
Andy Jeffries | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

Mar 5 '06 #6

"Andy Jeffries" <ne**@andyjeffries.co.uk> wrote in message
news:pa****************************@andyjeffries.c o.uk...

But most hosts would do it now on the fact the client says "we're going to
be going dedicated in 3 months and will be considering your company for
that, in the meantime would you....."

It may help if you get a sexy-sounding lady to call for you :-)


Exactly. They'll probably be a lot more helpful if they think you'll go
dedicated with them.

J
Mar 5 '06 #7

enko wrote:
We're going to be upgrading to a
dedicated server within a few months and surely there is a way for the
server to automatically run a php script at regular intervals? Maybe
I'm just looking for the most difficult solution, but any help would be
appreciated.


Hello,

I've only had to deal with doing this on a shared hosting, so the
solution might be different than on your dedicated host, but you can
set up something called a cron job, which will run a script at a
particular time, or interval. I use a simple interface, through my
host's control panel, but you can also program cron jobs through the
command line.

Chris S.

Free Web Design Tools
http://www.impliedbydesign.com/free-...e-scripts.html

Mar 5 '06 #8

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

Similar topics

8
by: Max M | last post by:
Yesterday there was an article on Slashdot: http://books.slashdot.org/article.pl?sid=03/09/04/1415210&mode=flat&tid=108&tid=126&tid=156 It is about automatic code generation. I got interrested...
2
by: Konstantin Zakharenko | last post by:
Hello, Our QA team have running a lot of test scripts (for automated regression testing), they run them on the different databases (Oracle/MS SQL). Several of those tests are dependent on the...
5
by: Maximus | last post by:
Guys, I need to make an automated script that runs every x seconds without using a CRON job. I heard there was a way doing it only in PHP. If you know any function that can be used please inform...
13
by: Benny | last post by:
Dear All, I need to send a set of Emails from my application (reminders) each month 1st. Is there anyway in ASP scripts to trigger an event to run automatically? I have no dedicated server, so...
2
by: Joe Shum | last post by:
Hi All: I am pretty new at ASP.NET development. Currently I need to build a Web Server app using C# and ASP.NET to automatically and repeatly refresh data changes at fixed intervals (2 to 30...
9
by: Sean Shanny | last post by:
To all, I restarted postgres this morning to make a configuration file change take effect and when I looked at the serverlog to make sure things were ok I found the prior shutdown message(*in...
6
by: bmjnine | last post by:
Hi all, I am trying to setup a daily task in my .NET (1.1) application. The application is a project management tool, and the daily task I am trying to set up will check for overdue project...
1
by: gomzi | last post by:
hi, I feel the need to use a script which will perform some predefined tasks at regular intervals. But since my hosting company does not allow me to use scripts that run at predetermined intervals,...
1
by: lenygold via DBMonster.com | last post by:
I found this query on older thread and i can not uderstand output interval pairs: How to find min and max values in date intervals: -------------------------------------------------- Input:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.