Sentora Support Forums
Some Edition crontab - Printable Version

+- Sentora Support Forums (https://senforums.mach-hosting.com)
+-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5)
+--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32)
+---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36)
+---- Thread: Some Edition crontab (/showthread.php?tid=3974)



Some Edition crontab - superstarnetworks - 08-15-2017

Hello 

First things apologize for my bad english ..
today i fixed alot cron job delete issues and added 15 mins cron tab
when add cron job with cron manager .. its Okie
then i delete cron job in my panel .. its deleted on panel ..
but still not delete on root SQL DB  .. sentora_core => x_cronjobs list
then i delete some core from etc/sentora/panel/modules/cron/code/controller.ext.php


Here how to fix 

  static function doDeleteCron()
    {
        global $zdbh;
        global $controller;
        runtime_csfr:Tonguerotect();
        $currentuser = ctrl_users::GetUserDetail();
        $sql = "SELECT COUNT(*) FROM x_cronjobs WHERE ct_acc_fk=:userid AND ct_deleted_ts IS NULL";
        $numrows = $zdbh->prepare($sql);
        $numrows->bindParam(':userid', $currentuser['userid']);
        if ($numrows->execute()) {
            if ($numrows->fetchColumn() <> 0) {
                $sql = $zdbh->prepare("SELECT * FROM x_cronjobs WHERE ct_acc_fk=:userid AND ct_deleted_ts IS NULL");
                $sql->bindParam(':userid', $currentuser['userid']);
                $sql->execute();
                while ($rowcrons = $sql->fetch()) {
                    if (!fs_director::CheckForEmptyValue($controller->GetControllerRequest('FORM', 'inDelete_' . $rowcrons['ct_id_pk'] . ''))) {

                        $sql2 = $zdbh->prepare("UPDATE x_cronjobs SET ct_deleted_ts=:time WHERE ct_id_pk=:cronid"); 
<= delete and replace with this =>
                        $sql2 = $zdbh->prepare("DELETE FROM x_cronjobs WHERE ct_id_pk=:cronid"); 

                        $sql2->bindParam(':cronid', $rowcrons['ct_id_pk']);

                        $sql2->bindParam(':time', time());   <= delete this one
                        $sql2->execute();
                        self::WriteCronFile();
                       self::$ok = TRUE;
                        return;
                    }
                }
            }
        }
        self::$error = TRUE;
        return;
    }



15 Mins cronjob added


static function getCreateCron()

add this line under of Every 10 minutes

$line .= "<option value=\"0,15,30,45 * * * *\">" . ui_language::translate("Every 15 minutes") . "</option>";



static function TranslateTiming($timing)

add this line under of Every 10 minutes

if ($timing == "0,15,30,45 * * * *") {
            $retval = "Every 15 minutes";
        }


//// done ////

If somethings wrong pls help me admin !


RE: Some Edition crontab - TGates - 08-15-2017

The addition of the 15min cron selection is OK. Changing how Sentora 'deletes' the cron jobs is not. It is done that way by design. It 'marks' them as deleted rather than completely remove them. This way if a customer is having an issue the admin can look back and see what they are doing wrong and can also be used to see if a client is trying to do something that may damage the server (hacking). If you want to delete older DB entries use the admin module 'Deleted Records Manager' found here: ##1617‍ 
I suggest you edit the above to just include the 15 minute cron jog selection Cool


RE: Some Edition crontab - superstarnetworks - 08-15-2017

(08-15-2017, 01:38 AM)TGates Wrote: The addition of the 15min cron selection is OK. Changing how Sentora 'deletes' the cron jobs is not. It is done that way by design. It 'marks' them as deleted rather than completely remove them. This way if a customer is having an issue the admin can look back and see what they are doing wrong and can also be used to see if a client is trying to do something that may damage the server (hacking). If you want to delete older DB entries use the admin module 'Deleted Records Manager' found here: ##1617‍ 
I suggest you edit the above to just include the 15 minute cron jog selection Cool

thanks you . i will edit back delete session  Big Grin
Sentora support stay fast    Cool i hope 1.0.4 official release will be out soon  Drunk