Cron Job help

Forum
Last Post
Threads / Messages

KatFennec

Member
Member
Joined
Apr 21, 2017
Messages
57
Points
0
Age
30
Mysidian Dollar
4,476
I'm trying to set up cron jobs to decrease a stat several times a day on each adoptable, but I'm running into some trouble and I'm not sure if it's the cron job itself or the PHP. Note that I'm specifically interested in Cron Jobs, not scheduled tasks.



cron.php
PHP:
<?php
class CronController extends AppController{

    public function __construct(){

    }
    
    public function index(){

    }
    
    public function lowerFullness() {
        $mysidia = Registry::get("mysidia");
        $mysidia->db->update("owned_adoptables", array("fullness" => -10));
    }
    
}  
?>
 
I wanted to rip my hair out so bad trying to figure this out a long time ago, but I found the answer a few minutes ago!

There is actually nothing wrong with your cron.php. When you create the cronjob in cPanel, the command has to be:
So replace 'function' with whatever function you are trying to run in cron.php and it should work.

EDIT: Also apparently using math right there with UPDATE will not work. See here for a fix
 
Last edited:

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,130
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top