PDA

View Full Version : Scheduled it Task Help


TheSupportForum
11-12-2012, 01:18 AM
Hi i need some extra support on a Scheduled task

1) the scheduled task will work if you run manually

but for some reason at the scheduled time after its run it does not created the file
at all, if someone could please look over this scheduled task to see why it might be happening




// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
exit;
}

// ##################### DEFINE IMPORTANT CONSTANTS #######################


// ################################################## ######################
// ######################### START MAIN SCRIPT ############################
// ################################################## ######################

$logfile = $vbulletin->options['ag_path'];
$logurl = $vbulletin->options['ag_url'];
$logname = $vbulletin->options['ag_thefilename'];

echo "backup of your file

";
echo "Finished

";
$logfile = $vbulletin->options['ag_path'];
rename("$logfile/$logname", "$logfile/backup/" . substr($logname, 0, -4) . '-' . date("d-M-Y", time()) . ".txt");
echo "C'est fini. You can view your logs
\n
";

log_cron_action();

nhawk
11-15-2012, 07:59 PM
It's running, you're probably not seeing the warning about the log_cron_action missing parameters.

Change this...
log_cron_action();

To this..
log_cron_action('',$nextitem, 1);

Also, be sure the file you're trying to rename is properly closed and not being written to before renaming it.