To collect the cron execution execution log in a file :
30 18 * * * rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log
About Magento, Linux, Jquery, PHP ... and other!
30 18 * * * rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log
* * * * * command to be executed
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
export EDITOR=vi ;to specify a editor to open crontab file.
crontab -e Edit your crontab file, or create one if it doesn't already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file. (This option is only available on a few systems.)
strlen()
. However, there is a faster method. Take a look at the following code example:$string = 'testing';
if(isset($string[6]))
echo "The string '$string' is at least 7 characters long.";
else
echo "The string '$string' is less than 7 characters long.";
$string
value like an array by passing an integer value to isset()
. If that number plus one is greater than or equal to the number of characters in the string, it will return true. You need to add one because it is zero based.Echo
like a Functionecho
, you needed to use periods. But you can actually treat echo
like a function and use commas instead (it is also faster). Take a look at the following code:$string1 = 'test-string1';
$string2 = 'test-string2';
$string3 = 'test-string3';
echo 'String #1: ', $string1, '
';
echo 'String #2: ', $string2, '
';
echo 'String #3: ', $string3, '
';
$var1 = 'nameOfVariable';
$nameOfVariable = 'This is the value I want!!!';
echo $$var1;
ob_start();
echo 'Print to the screen!!!';
$getContent = ob_get_contents();
ob_end_clean();
// Do whatever you want...
// Do something with the printed content (only if you want)...
echo 'Now: ' . $getContent;
$reponse = new Varien_Object( );...$reponse->setTimeserver( Mage::getModel('core/locale')->storeTimeStamp( Mage::app()->getStore() ) );... ... ...$this->getResponse()->setBody ( $reponse->toJson() );