Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-10-2009, 03:31 PM Cronjob help needed!
Average Talker

Posts: 15
Name: Declan Dowling
Trades: 0
Hello,

I need some assistance with setting up a cronjob in DirectAdmin.
Here is the code that I want to execute every hour.
PHP Code:
<?
include 'includes/connect.php';

mysql_query("UPDATE `bullet_factories` SET `bullet_stock`=`bullet_stock`+250");

?>
(There's nothing wrong with that, right?)

Here is the path to my file:
home/admin/domains/mydomain.com/public_html/cronjobs/mycron.php
(domain changed)

I have everything set to '*', and hour set to '0'.

Whats wrong!?

Last edited by Declan; 04-10-2009 at 04:22 PM..
Declan is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-10-2009, 04:20 PM Re: Cronjob help needed!
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
By setting the hour to zero, it will only run once per day (on the zero hour, midnight).

Set the minute to zero, asterik on everything else.
That will every "zero" minute, once per hour

Here are some examples
0 * * * * # Run every hour at the top of the hour
15 * * * * #Run every hour, 15 minutes after the hour
0 2 * * * # Run every day at 2 in the morning
__________________

Please login or register to view this content. Registration is FREE


Last edited by willcode4beer; 04-10-2009 at 04:23 PM..
willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 04-10-2009, 04:23 PM Re: Cronjob help needed!
Average Talker

Posts: 15
Name: Declan Dowling
Trades: 0
I'll give it a try, thanks.
Declan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Cronjob help needed!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11571 seconds with 12 queries