Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Cron Tasks


I'm building an auction site which needs scripts automatically launched to scan the closing auctions. I'll use Linux's crontab.

I'd prefer to avoid installing Php as a cgi and prefer to keep my apache module config.
I'd also prefer to avoid the use of a browser as lynx to do this job because I fear the time-out How I can launch my scripts?




View Complete Forum Thread with Replies

Related Forum Messages:
Cron/scheduled Tasks
Im running my site on a web server, and want to add something so that every hour the variable $gold = $gold*($workers*3.1) +($banks*30); and the way to do this is cron jobs from what ive gathered from searching google. BUT not only haven't i found a good tutorial, but I haven't found a single example taht isn't with CGI or a download.

View Replies !
Cron Jobs / Tabs / Tasks And More
I'm building a site with a mySQL db behind it.
There are going to be a lot of records in it with products.

Now i have recently discovered cron jobs, and i thought it
would be a good idea to use those to backup the database.

i have a few questions:

- If i back up the database, does it put the backup
in an actual different db, or just in the same db but
other tables? (Silly question maybe, but i'm new to this)

- Can the DB still be queried bij site-visitors though it's
being backed up?

- Is it possible to just backup new/updated records instead of the
entire db?

- Imagine i backup once a month. can the cron job notice
if the DB is dameged/ has errors, so it'll stop backing up
so it doesn't overwrite the previous backup... or doesn't backup
delete the previous backup?

View Replies !
PHP Tasks
some times i get this error on my script: Internal Server Error

i researched very much on why this error happens and i get to: i forgot to close some php tasks in my script.

now i know only mysql_close() for closing one of php tasks. what are others php tasks that need to closing?

View Replies !
How Can I Automate PHP Tasks?
I am currently running the same task multiple times a day and I'm sure there is a way to automate it. It is a simple one, but with limited PHP knowledge I'm not sure of the best way to do this. Here's what I need to do

1) log-in to a 3rd party site

2) Download the CSV

3) Upload to my db

View Replies !
Background Tasks
I'm using some weather rss feeds in a web site. The feeds are updated once every hour and cached in a local file. My problem is that every time the weather report is updating I get a long wait (not that long.. 2 or 3 secs) before the page is displayed.

This happens becauses the teplate engine that parses the page is waiting for the weather section to be parsed and cached. Is there a ay I can start the weather parsing as a background thread and return immediatly to the template engine to continue to parse the page? And if so How?

View Replies !
Automated Tasks
I have an auction site running. Now I want the auction to be able to automatically send a mail msg to the seller after it expires. How do I do it? Obviously there is some sort of way that I can employ so that this task does not require an operator (such as me) to run manually. This task will involve accessing the database and sending an email. Can somebody enlighten me on this?

View Replies !
Directory Tasks
Im looking to do some work with directories. Basically, there are some directories which I want my website users to access fully, and see all the files in there.

My server allows index of directories automatically, where users can see all the files in the directory (unless there is an index page). Code:

View Replies !
Using PHP For Nightly Backend Tasks?
I have to develop a script to be run nightly to go through a database
and send emails based on conditions. It's a large database, and there
are several thousands of emails to be sent during the week everyday.
The script will be run with a cron job at midnight or so.

I was wondering if PHP is suitable for this, or may it be problematic,
for instance would its execution abort after a certain amount of time?
Or is it perfectly fine for this task?

View Replies !
How To Execute A Tasks If The Time Is 22:30:45
crontab work every minute

How to execute a tasks if the time is 22:30:45 or 22:31:01

id | time | script
-------------------
4 | 22:31:01 | script0.php
3 | 22:31:00 | script1.php
2 | 22:30:45 | script3.php
1 | 22:30:00 | script2.php

View Replies !
How To Schedule Tasks On Website.
I am trying to figure out how to schedule tasks on my website. For example, PAGE1 should perform a different task in the morning than in the afternoon.

And at the end of the day, I have to extract some data from the database and put them into a file. This should be done automatically.

View Replies !
Script In Windows Tasks
I would like to know how do i work with php in windows tasks. i developed a php web application and i would like to recieve to my email every day a certain report which will be produced by a php script.

View Replies !
PHP/mySQL Running Tasks Automatically?
I have a MySQL DB with all my client details (name, email address etc).

I want to use PHP to retrieve records from the DB and email each of these clients (easy enough) BUT I want the system to automatically do this at pre-defined times.

I have thought about using the UNIX/Linux CRON utility to perhaps call a PHP script that would retrieve specific records (based on a timestamp perhaps?) and then have it email based upon those records.

Does this sound feasible? Are there better ways to do this?

View Replies !
Executing PHP Tasks While Letting A User Continue To Browse?
I was wondering if someone could help me out with the following two
situations.

In a lot of my web apps, it seems that if i launch a PHP script that takes
a long time to complete, the user is unable to browse/use the rest of the
website until the tasks completes. Is there a way to avoid this?

Specifically, app #1 let's a user choose which files to include in a zip
file, then PHP makes the .zip file on the server and streams it to the user
via fopen/fread. So, as the user is downloading a file on the side (it
presents them with the open/save dialog) they are unable to browse the rest
of the PHP-based site until the download completes; clicking on any links
to pages does nothing, the browser just sits there until the file has been
downloaded, THEN the screen advances.

I am experiencing a similar thing with a PHP mail delivery system. I tried
to create a work-around: a pop-up window that sends an 'exec' command to
the a php-script that sends the email to a few hundred recipients. Again,
even though this action is being done in a pop-up window (and via the
command line, no less), the user is paralyzed in the main window until the
action completes.

View Replies !
Sending Mails Without Using Scheduled Tasks (crone Jobs)
Can we set up a mail program that the mail can sent frequently..ie may be daily or weekly or monthly... with out using scheduled tasks or crone jobs.

for eg .. can we create a page that works like the scheduled tasks page( there we can set up the time at which time the program  will execute )..that means we have options in our webpage to set up the time  at which the mail will sent. for eg..every monday.. can we set up this in the program without using scheduled tasks or crone jobs. can we run our page  frequently without using crone jobs .

View Replies !
Help With Cron
I need some help with starting to use cron to auto update one folder from another folder remotely. I have no idea where to go and can't find a good tutorial or book on it, anybody have suggestions.

Eventually, I want to use one of my websites to update the pagtes on another, the hosting company won't set it up on the server for me so I need to develop a script i can run in php.

View Replies !
Cron Job Help!
I've been reading around with this but can't seem to find an easy example! I have NO idea how this works at all.

All I want to do automatically dumb the database to an email every morning at 4am, I know this IS possible but other than knowing I have to use cron, or cronjob.

Any help, or simple script showing me how this works would be much appreciated, I'm on PHP3 atm, but am moving to a new PHP4 server shortly.

View Replies !
Php Cron
Is there a way whereby when the cron I've set start to execute a particular command, while when the command gets back a positive response, it will stop the cron from running anymore?

For example:

cron start => execute command => 1 = true; 0 = false;

if 1, stop the cron completely from running anymore

if 0, continue to run as schedule in the cron file.

Another question is:

How many cron file can one server have?

View Replies !
CRON
I am just starting messing with CRON. I can set up a cron job to run a php
script each hour, but I have several web sites on one server that may need a
script running.

I was contemplating running one "manager" script each hour that would check
a mysql table and where necessary run one of a range of possible scripts,
probably one at a time to spread any load.

1. Is this the best way of doing this?

If yes, what fields do you recommend? (id, ref, scriptURL, timestamp,
active(1/0))

Is it worth creating a log file to keep an eye on what and when scripts have
run?

View Replies !
Set Up A Cron Job
I am looking to set up a cron job using PHP... I need a script to set up a cron job on the server to send out a blast email.

View Replies !
How To Set Up A Cron Tab?
Does anybody know how to set up a cron tab?

View Replies !
Cron And Php
Im trying to execute a php file at intervals using cron. if i call the file from my web browser it runs fine , but if i setup a cron job in cpanel , when the script runs , it just emails me a bunch of errors. is their anyway i can make this happen with cron?

View Replies !
Php Cron Job
how to do cron job in php I need to send email at pparticular time in some day , how to do that one.

View Replies !
Using Cron
I am working on a project. My project requires me to run a script everyday to query data but I don't really know if it is possible and how it is done inside the cron menu in Cpanel.

View Replies !
Php And Cron
I have a page with an expiration date on it along with some other variables. Then I have a script page to check that page to see if it has expired by checking the date function on my server then email if it is.

I have set up cron on my server to run the script page at a certain but when i get the cron email it tells me that there is a Syntax error: newline unexpected. I dont understand this because without cron just by opening up the script page it works just fine. Can someone help explain this to me please?

View Replies !
Run Cron
Code:

0 7 * * * cronlog "/usr/local/bin/php wget /var/www/html/fantasy_baseball_rankings/admin/getinjuries.php"
0 19 * * * cronlog "/usr/local/bin/php wget /var/www/html/fantasy_baseball_rankings/admin/getinjuries.php"

I'm trying to run these two scripts via cron at 7 AM and 7 PM.

View Replies !
Cron Job
I'm trying to create a cron job that deletes the database tables and then restores them automatically using a cron job. What I want to know is how would I insert the SQL commands to enable that restoration process to occur from the .sql file from phpmyadmin. I could just use the sql file in phpmyadmin but I want to do it automatically every few hours. And I have read many many questions similar to mine and the anwers were to use SSH, I don't have access to SSH on my server.

View Replies !
Cron Tutorial
anybody now good tutorial on cron??
thanks

View Replies !
Cron Daemon
does anyone know of any good tutorials on using the cron daemon to set up scheduled tasks?

View Replies !
Set Up Cron Jobs
I have to set up some cron jobs but I don't know anything about them, is there a place that someone knows of where i can learn about them? or tell me how to do them?

another question, i'm also trying to set up a search for my site...how do u split up a sting so you can search for each individual word? for example if someone does a query for "billy boy", how do i split up the string so it can search for both words, "billy" and "boy", instead of just "billy boy"?

View Replies !
Setting Up A Cron-Job
I need to setup a cron-job through a PHP Script.

If anybody does know how to do this through php script.

View Replies !
Non-Cron Crons
I need to 'run' a php script on a scheduled basis (i.e. hourly). However, my hosting company doesn't allow crons and the like.

My alternate strategy is to have my pc dial up and call the controlling php page. Does anyone know of a scheduling/dial-up utility (which will run under NT) that will help me achieve my goal? Or any other methods?

It's been suggested that I let visitors trigger the script, but the script processing may take some time and annoy the user.

I realise this isn't strictly a php question, but was hoping others might have found themselves in the same situation as myself and now have a solution.

View Replies !
Cron Running PHP
what would a cron command look like that runs a specific PHP script every hour?

View Replies !
How To Run A PHP Script Using Cron Job?
I am doing a application using WAMP. In a certain step i need to run
some php script using cron Job. But i don't know how to configure the
cron job in windows. I also don't know how to configure cron job in
Linux.

i search Internet but i failed to configure that. So i need a simple
configuration tutorial from our Experts.

Example:
1). i have a script named "test.php"
2). i have a DB Backup Script "dbBackup.php" and i need to run this
script daily at 23:58:00 time.

View Replies !
PHP And Cron Using Cpanel.
The script updates ONLY by hitting the page with a browser.

I've tried using

wget -O /dev/null user:pass@http://members.mydomain.com/script.php?update=true

and

php /home/mydir/public_html/members/script.php?update=true

I've even used:

wget -post-data 'update=true' user:pass@http://members.mydomain.com/script.php

The only thing I can get to not error on me is:
wget -O /dev/null -post-data "update=true" user:pass@http://members.mydomain.com/script.php

That simply returns my shell prompt without any errors. It doesn't update the page.

I'm using Cpanel and I don't know if that may be the problem or what...

My absolute basic question is...

How do I call this url via cron/shell and have it update?
http://members.mydomain.com/script.php?update=true

I'm pulling my hair out here and my "buddy" won't work on this unless I'm paying him because he says the script is fine! - UH!

View Replies !
Cron Questions
Just a few questions about cron files:

Can I include other files? Eg

<?php
require(config.php);
....

That's pretty much it! I'm running a cron job from DirectAdmin and I keep getting an error email with:

/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 1:?php: No such file or directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 2: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 3: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 4: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 38: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 39: syntax error near unexpected token `('
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 39: `$udq = mysql_query("SELECT * FROM $CustomersTable",$Link) or die(mysql_error());'

And if I run the file in my web browser, it works fine! Confused :S

View Replies !
PHP, AWSTATS, & CRON
Does anyone know of a tutorial to write a PHP script that will grab the number of unique visitors from AWSTATS data txt file, then email it? Eventually, a cron job will be created to email the results.

Even a script someone has written will be helpful to see how it's done.

View Replies !
PHP Kill Cron
How can i kill a cron process at the begining of my cron task (php script):
My cron task starts evry 5 minutes, but may work more than this time. (no timeout configured on my server for cron tasks (?).

I guess if i can stop every process of this task before starting it again.
my task looks like:...

View Replies !
Pseudo-cron
Harry Fuecks well known PHP writer suggests for those that have difficulties in accessing “cron” to utilize “pseudo-cron”. I D-loaded it as a zip; it seems quite straightforward and easy to use.

As usually with a cron job one is responsible for the php scripts that contains the cron-job to be performed. Also Harry recommends that if in your php.ini setting “short_open_tag” is off to edit the pseudo-cron files and make short tags: <? The full <?php initial tag.

If you are interested in D-loading it (it is free under the GPL)
http://www.bitfolge.de/?l=en&s=pseudocron
(I did left the URL as is so you can see the address)
It is clean I scanned both the zip and unzipped files

So the question before out of curiosity I give it a try is:
Has anyone tried it?

View Replies !
Run A Cron Job For A Php File?
Is there a way to run a cron job for a php file? I know if I want to run a cron job for a cgi script I just write the full path to the script in webmin.....but when I do the same with php it doesn't seem to work.

View Replies !
Something Like Cron On Windows?
I have Windows XP professional. Is there ANYTHING reliable on Windows
that is like cron on UNIX that will allow you run something at regular
intervals, for example, like every 10 minutes?

I would like to change a (static/.html) web page every 10 minutes using
PHP, is there a way to do this? I have an Apache/PHP/MySql also, so
maybe theres a way to do it through these programs. Has any one done
this before? How?

AT will not do what I want, and SCHTASKS has a lot of bugs, and will not
allow me to run a program in the background.

View Replies !
Cron Job Every Minute
I run cron every minute to refresh the index page of my message boards in order to reduce server load by making the index page a static page. The output is fine. The problem is that I guess when the old pages is being replaced by the new page there is a brief period every minute where if you go to the index page you see a blank page.

View Replies !
PHP, CRON And PLESK
Is there any up-grade at Plesk to allow me to work with cron? I need cron in my daily work and my host provider told me that he did not know about any kind of up-grade.
I'm interested to run PHP script daily and i would like to know if this can damage to the server security.

View Replies !
Cron Timeout?
can a php script running on a cron timeout? If so, how can this be avoided.

View Replies !
Cron Not Working With Php+gd
I'm trying to run the following php code along with gd library as a
cron job ,but cron is not generating any output.
When I run this code from my browser I get an image correctly.
Somebody please tell me what needs to be done to get an image via cron
job.
<?php
//Header("Content-type: image/png");
$height = 300;
$width = 300;
$im = ImageCreate($width, $height);
$bck = ImageColorAllocate($im, 10,110,100);
$white = ImageColorAllocate($im, 255, 255, 255);
ImageFill($im, 0, 0, $bck);
ImageLine($im, 0, 0, $width, $height, $white);

for($i=0;$i<=299;$i=$i+10) {
ImageLine($im, 0, $i, $width, $height, $white); }

ImagePNG($im,"x.png");
?>

View Replies !
Cron Job As A Cgi Script
in case you don't know a cron job is a cgi script which gets executed at certain times or intervals. i need to do this with php for a new site i am working on. any ideas?

View Replies !
Log Logging & Cron
I have a scheduled job / cron-job - which (working from memory)
goes

PHP file to process > log file >> error log


Each time the cron/scheduled job is activated, it replaces the
log file...

I was wondering, is there a way that we can insert a command to

a) 'stop' the logging of the cron output at a certain point

b) Email the file to an address

I'm guessing No - so i'll have to manually create a log - in the
programme/ascript & save it at the end of each script... (& email
on demand)...

View Replies !
PHP Cron Jobs
I'm trying to set up a PHP cron job. The email i recieve to say that it's executed properly doesn't seem to like my comment codes and appears to be trying to find a file (reading the // as a file path presumably). Has anyone else had this problem? If so, how do i resolve it? Also are includes run in PHP Crons too? Perhaps this is causing my problem.

View Replies !
Setting Up Cron Job !!!
I need help creating a PHP script that will ... import - ID, user_login and user_pass - into wp_users from another table called jos_users (located in the same database) where these three fields are called - id, username and password.

I need to set up a cron job to do this because new users are being continuously added to the source table.

I can decipher PHP but I can't write it. So, I need someone to code this for me. Hoping some kind and knowledgeable soul will read this and offer their services.

Linux, i686
SQL: 4.1.22-standard
PHP: 4.4.7
Apache: 1.3.37 (Unix)

View Replies !
Strtotime And Cron
I've got a db of events which have dates attached to them which have been created using strtotime().  They don't have any time.. just the date.  I've got a script which gets today's date using strtotime("today").  I use this as a comparison to find events which happen today.  This works fine when I call the script from a URL, however when I called the php file from a cron job... the strtotime("today") creates values which are different each time.

Are there any thoughts on what could be causing this?  Firstly, I was wondering if the cron job was somehow using a different timezone to me (I'm On GMT).  How do I explicitly tell php to use GMT.. .but then again.. this should matter too much, because I jsut want to date not the time!  It also wouldn't account for the changing values of strtotime("today").

Just out of interest, does php4 and php5 handle strtotime("today") differently?  I'm just wondering if cron is using the correct version of php?

View Replies !
Cron Issue
I'm having a problem with a cron, instead of executing the cron every 15 minutes like it's supposed to it's setting the last run for each job like it already executed and bypassing it. Here's the query that's not working correctly. Code:

View Replies !
Cron Updates
I would like to know how I should go about doing the following:

I Have a number of crons +-11 I would liek to show when the last cron updated and when the next one will update(have it as a count down). I have thought about setting it so it updates something the the database, and then get a live clock that works with server time that counts down.

The problem with that is when the server has downtime, then the script's time will be inaccurate. See i do not host my crons on the same server as i keep my website. How should i go about doing this?

View Replies !
Create A CRON Job With PHP
I'm working on a mailing program that will hopefully send mails out to around 100,000 people. I've got search queries that get all the email addresses from my DB and fills a temporary table with the results.

I then want a user to be able to press "send" on their email that'll create a CRON job which will go down the populated list and send all the mails, flagging each one as done as it happens.

The reason i want the CRON is so the user can turn their computer off and the CRON will just get on with it. Can anyone tell me how i might go about creating this CRON from php? Or if there's a better way i'm not thinking of.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved