My html directory is becoming bloated so I am trying to reorganize the files. I have a few scripts that I have running on a cron job and I want to move them out of the html directory.

For example:

cronjob: php /chroot/home/mydomain/html/restock.php



my script


What I would like is a directory called 'myscripts' or similar and have all my scripts sitting in there. My question is what is the best practice for this and also how would I modify my php scripts and cronjob???

1 Answer 1

require_once 'abstract.php';

class Mage_Shell_Restock extends Mage_Shell_Abstract {       
    protected $_stock;
    public function run()
        if(true) {          
            //process your logic
        } else {
            echo $this->usageHelp();

     * Retrieve Usage Help Message
    public function usageHelp()
        return <<<USAGE
Usage:  php -f restock.php -- [options]  
  help              This help

$shell = new Mage_Shell_Restock();

You will find shell directory in magento root. place this file in shell directory.

Add add file in crontab via cpanel or run via ssh.

php /chroot/home/mydomain/shell/whateverfilename.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.