In some cases, you would need to create different kind of tasks or processes, regardless the Magento standard flow.
That is when you will need a standalone script, and that’s a simple example of how can we create one.
Create a new file inside root/shell directory called test_script.php with the following content:
class Offset101_Shell_Testingscript extends Mage_Shell_Abstract
public function run()
echo "¡Hello world!";
$shell = new Offset101_Shell_Testingscript();
Note: It’s mandatory to create the run() method inside our extended class.
Then, you can run your shell script, on your terminal, with the following command:
php -f test_script.php
It would be helpful for you, visiting this following article, where i’m showing many useful code snippets that are pretty common inside Magento shell scripts: