Topic: cron_maintenance.php HELP PLEASE
My server is running the cronjob command tab to run cron_maintenance.php with
php/home/SITEUSERNAMEHERE/public_html/JOBBER/cron_maintenance.php>/dev/null2>&1
but the email notification says...
/bin/sh: /dev/null2: No such file or directory
so I tried the following variants but nothing works...
php/home/SITENAMEHERE/public_html/JOBBER/cron_maintenance.php>
php/home/SITENAMEHERE/public_html/JOBBER/cron_maintenance.php
<php/home/SITENAMEHERE/public_html/JOBBER/cron_maintenance.php>
I know the .php file is in the correct directory. And I'm using the Standard Interface.
I understand that by default cron jobs sends a email to the user account executing the cronjob. And to disable this add >/dev/null 2>&1 to the end of the cron job line .
Would anyone know why it says "No such file or directory"?
The class.Maintenance.php is (yes...it's set to delete jobs after 1 day...for testing purposes)
<?php
class Maintenance
{
function __construct()
{ }
// delete temporary posts older than 1 days
public function DeleteTemporaryJobs()
{
global $db;
$sql = 'DELETE FROM jobs WHERE DATEDIFF(NOW(), created_on) > 0 AND is_temp = 1 AND is_active = 0';
$db->Execute($sql);
}
public function DeactivateOldJobs()
{
global $db;
$sql = 'DELETE FROM jobs WHERE DATEDIFF(NOW(), created_on) > 1';
$db->Execute($sql);
}
}
?>
The cron_maintenance.php is...
<?php
require_once 'config.php';
require_once '_includes/class.Maintenance.php';
$janitor = new Maintenance();
// delete temporary posts older than 2 days
$janitor->DeleteTemporaryJobs();
$janitor->DeactivateOldJobs();
?>
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)