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/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 Complete Forum Thread with Replies

Related Forum Messages:
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 !
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 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 !
Scheduled Events
possible to get php to execute a script at certain times a day ? or is the only way to have a list of set times in a db, and when each user comes to my site see if it has been done or not ? and do, or dont do accordingly?

View Replies !
Scheduled Scripts
Can anyone tell me if there is a way of having a PHP script run at a scheduled time each day? Our ISP's server is running under Linux and I was hoping to use something called CRON. However my ISP has told me this is not possible, and I will need to write the script in PERL.

View Replies !
Scheduled E-mails
I would like to create a "send out scheduled e-mails" function in my
PHP application.
I guess it would be hard to program this function using PHP.
What ways can I implement this?

View Replies !
Using Scheduled Task
I have a php code which when executed fwrites the contents into a file. That works fine.
But when I use the windows task scheduler to execute it, windows a return of (0) which means no errors but the file doesn't seem to be executed. The thing is that prior to me adding the functionality in the PHP code to produce output to a file, using scheduler to run the file was fine.

View Replies !
Scheduled Task
setting up a task to run nightly? The problem at hand is, company A stores data on company B's server. Then nightly, company B creates an XML feed for them to take the updates and put them in there own database server (that I am going to set up). The website never sends updates back, the only updates from company A are from inside there office system.

So, what I have to do is take this XML feed and put it in my own server. It could be a fairly large number of records (500 maybe) - So I'm not sure how fast it could realistically be parsed through and then added to the database. How do I go about this without checking each time a user visits the website? It needs to be automatic too, rather than somebody going to the specific page each night and clicking 'go'.

View Replies !
Scheduled Mysql Queries?
How do you schedule a mysql query? Like (half pseudo-code):

mysql_schedule("every five minutes");
$query = mysql_query("SELECT some integer");

$int = mysql_fetch_array($query,MYSQL_NUM);
$int[0] += 10;

mysql_query("INSERT $int")

or something along those lines...I want my users to accumulate "taxes" every turn..even when their not playing..turns will last 5 minutes.

View Replies !
Automatic Scheduled E-mails
I have a website that I am building in PHP that I would like to send e-mails
to users every 2 days to inform of new updates. I know how to trigger the
sending of e-mails if a user enters the site, and can limit this to only
happening once every 2 days, but I am interested to know if it is possible
to have PHP send e-mails automatically in case no one visits the site?

View Replies !
Script To Run At A Scheduled Time
I would like to know if there is a way I can get a PHP script to run at a scheduled time? Is there a command or do I have to do something else?

View Replies !
OT (possibly): Scheduled Actions
I've got a dedicated server running Windows 2003, IIS, MySQL and PHP.

I'm working on a web site which needs to pick data up on a semi-regular
basis from a CSV file which will exist in a directory accessible to this
server. The data will be put there by another server.

I need to pick up this data and insert it into a MySQL table; I have three
options in theory - do it on a strict schedule, do it on request by an admin
user (the easy option), or have it happen automatically if a file drops into
that directory.

Can PHP do this, or do I need to look at something else to do this for me? I
can install/setup anything I like on this server, within reason.

View Replies !
Scheduled AT Job Reports 'The Account Is Currently Not Available'
I am scheduling an AT task from a php file using sudo and user 'joe'
that reports correctly when using atq from the command line.

However, although the script being executed by the job runs ok from
the command line I get a mail message saying 'The account is currently
not available' when the job is scheduled by php?

It's not an 'apache' user problem as far as I can see as the task is
getting scheduled as 'joe'.

View Replies !
Running A Scheduled Task
I would like to run a simple php file that backs up my database. The file is in one of the virtual directories. I know I can do it with other ways, but I'm interested in how to do it on a windows OS, and using the windows scheduled tasks wizard - if possible. I've read that parameters need to be set up, but I don't quite understand what that means. how I can do this in a simple step by step fashion?

View Replies !
Scheduled FTP & Database Export
We currently have an online dedicated server where users can apply for jobs and attach their resumes, we have also setup a similar environment on our local machine for a system which we use to extract the applicants information and match it to the jobs we have.

Everyday we get an average of about 150-200 job applications which translates to the same number of resumes.

I need to be able to automate the process by which the resumes are downloaded everyday and stored on the local server and also schedule a database backup which should in essence export the database a set of sql statements which I can then run. The dedicated server has a PLESK interface which gives me access to the Cron Jobs interface, I just don't know how to proceed.

View Replies !
Scheduled Chunks Of Code
What I want to do is have a chunk of my code for my website only be accessed once a week on a set day. its basically a poll, that I want to find the highest rating for, but not all the time, I want for it to be once a week..

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 !
[Q] Automatic (i.e., Scheduled) Access To Another Web Page
I need to be able update my web site with info from a remote web site. At
this other web site, the info I require is updated every 30 minutes, 24
hours per day. Life would be cool if a way existed by which I could
"schedule" my code to run periodically so that my info could remain
[reasonably] synchronized with the info on this other site.

In the PHP docs / books I have I've been unable to find functions / services
/ examples that might permit me to implement this functionality. Do [php]
services/classes exist that would meet this need? Do I need to invoke the
services of my WEB server (apache on both ends)?

View Replies !
Strange Characters When Script Run By Scheduled Task
I've written a script that is run on a Windows server which gets headlines from a remote webpage, and I'm using a scheduled task to run it on a regular basis. The problem is that swedish characters (åäö) gets replaced with other characters.Example: Quote: Boverket sõger ja till ICA Maxi.
v- och mp-r÷ster hotar budgetf÷rslaget. When I run the script from the web through my browser, it works fine. This only happens when I run it with a sheduled task.

View Replies !
Running Php File Everyday On Scheduled Time
Is there is way to run a php file perodically everyday on scheduled
time in such a way that there is no human interaction and it
performence the written task.

View Replies !
Automatic Scheduled MySQL Backup (MySQL Dump)
Is it possible to configure a UNIX/LINUX server to do a MySQL Dump for a database on an automatic schedule and then to email the dump file to me (the administrator)?

I want to be able to have my database automatically backed up every week and emailed to me for storage purposes without any action on my part.

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 !

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