Archive for February, 2012

Magento: Get a rough total for all rows in all tables in mysql

Tuesday, February 14th, 2012

$query = “SELECT table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ‘database_name_goes_here’”;

$result = Mage::getSingleton(‘core/resource’) ->getConnection(‘core_read’)->fetchAll($query);
$total = 0;

for( $i = 0; $i {
$total += $result[$i]['table_rows'];

}
echo ‘Grand Total = ‘ . $total;

Redhat – Sort log file by date

Sunday, February 12th, 2012

$ ls -l -r –sort=time