<?php
/**
 * AppShell file
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         CakePHP(tm) v 2.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */

App::uses('Shell', 'Console');

/**
 * Application Shell
 *
 * Add your application-wide methods in the class below, your shells
 * will inherit them.
 *
 * @package       app.Console.Command
 */
class AppShell extends Shell {
    protected function batchOperation($model, $operation, $options) {
        $batchSize = 1000;
        $proceeded = 0;
        $options = array_merge(
            array(
                'contain' => array(),
                'limit' => $batchSize,
                'offset' => 0,
            ),
            $options
        );

        do {
            $data = $this->{$model}->find('all', $options);
            $proceeded += $this->{$operation}($data, $model);
            echo ".";
            $options['offset'] += $batchSize;
        } while ($data);
        return $proceeded;
    }
}

<?php
/**
 * AppShell file
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         CakePHP(tm) v 2.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */

App::uses('Shell', 'Console');

/**
 * Application Shell
 *
 * Add your application-wide methods in the class below, your shells
 * will inherit them.
 *
 * @package       app.Console.Command
 */
class AppShell extends Shell {
    public $batchOperationSize = 1000;

    protected function batchOperation($model, $operation, $options) {
        $proceeded = 0;
        $options = array_merge(
            array(
                'contain' => array(),
                'limit' => $this->batchOperationSize,
                'offset' => 0,
            ),
            $options
        );

        do {
            $data = $this->{$model}->find('all', $options);
            $proceeded += $this->{$operation}($data, $model);
            echo ".";
            $options['offset'] += $this->batchOperationSize;
        } while ($data);
        return $proceeded;
    }
}

Allow to modify the size of batchOperation
Allow to modify the size of batchOperation
