Returns a list of all currently running cron jobs.
189338
def ListJobs(self, token=None):
    """"""
    job_root = aff4.FACTORY.Open(self.CRON_JOBS_PATH, token=token)
    return [urn.Basename() for urn in job_root.ListChildren()]
1345384
function () {
        const cronJobsToStart = _getNamesOfCronJobsToStart();
        if (!cronJobsToStart && _shouldStartCrons() && Shared.isDbConnectionAvailable() === true) {
            return CronJobManagerJob.startListening().then(function () {
                Logger.tag('Cron').info('Cron Job Manager is started. Starting all available cron jobs');
                return Q();
            }, function (err) {
                Logger.tag('Cron').error('Error starting Cron Job Manager ');
                return Q.reject(err);
            });
        } else if (cronJobsToStart && _shouldStartCrons()) {

            Logger.tag('Cron').info('Starting specific cron jobs "' + cronJobsToStart.join(', ') + '"');

            try {
                const cronJobs = Shared.cronModules(cronJobsToStart);
                let promises = [];
                for (let cron of cronJobs) {
                    // Set force run config
                    cron.forceRun = true;
                    promises.push(cron.worker(cron, cron));
                }
                return Q.all(promises)
                    .then(() => process.exit())
                    .catch(() => process.exit(1));
            } catch (err) {
                process.exit(1);
            }
        } else {
            Logger.tag('Cron').warn('Cron Manager is disabled for this environment.');
            return Q();
        }
    }
1346863
public function listJobs($crontab){

        $process = new Process($this->crontabCommand($crontab).' -l');
        $process->run();

        $this->error = $process->getErrorOutput();
        return $process->getOutput();

    }
87205
def get_queues(self):
        """"""
        res = self.celery.control.inspect().active_queues() or dict()
        return [result.get('name') for host in res.values() for result in host]
666319
def list_():
    '''
    
    '''
    autoruns = {}

    # Find autoruns in registry
    keys = ['HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run',
        'HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /reg:64',
        'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run'
    ]
    for key in keys:
        autoruns[key] = []
        cmd = ['reg', 'query', key]
        for line in __salt__['cmd.run'](cmd, python_shell=False).splitlines():
            if line and line[0:4] != "HKEY" and line[0:5] != "ERROR":   # Remove junk lines
                autoruns[key].append(line)

    # Find autoruns in user's startup folder
    user_dir = 'C:\\Documents and Settings\\'
    startup_dir = '\\Start Menu\\Programs\\Startup'
    full_dirs = _get_dirs(user_dir, startup_dir)
    if not full_dirs:
        user_dir = 'C:\\Users\\'
        startup_dir = '\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup'
        full_dirs = _get_dirs(user_dir, startup_dir)

    for full_dir in full_dirs:
        files = os.listdir(full_dir)
        autoruns[full_dir] = []
        for single_file in files:
            autoruns[full_dir].append(single_file)

    return autoruns
891052
public function getCrons(): array
    {
        /** @var CronInterface[] $crons */
        $crons = $this->cronService->getCrons();
        /** @var EdgarEzCron[] $ezCrons */
        $ezCrons = $this->repository->listCrons();

        $return = [];
        foreach ($ezCrons as $ezCron) {
            $return[$ezCron->getAlias()] = [
                'alias' => $ezCron->getAlias(),
                'expression' => $ezCron->getExpression(),
                'arguments' => $ezCron->getArguments(),
                'priority' => (int)$ezCron->getPriority(),
                'enabled' => (int)$ezCron->getEnabled() == 1,
            ];
        }

        foreach ($crons as $cron) {
            if (!isset($return[$cron->getAlias()])) {
                $return[$cron->getAlias()] = [
                    'alias' => $cron->getAlias(),
                    'expression' => $cron->getExpression(),
                    'arguments' => $cron->getArguments(),
                    'priority' => (int)$cron->getPriority(),
                    'enabled' => true,
                ];
            }
        }

        return $return;
    }
414879
def jobs(self):
        
        if self._jobs is None:
            self._jobs = JobTable(self.connection, self.database)
        return self._jobs
394371
def UpdateCronJob(self,
                    cronjob_id,
                    last_run_status=db.Database.unchanged,
                    last_run_time=db.Database.unchanged,
                    current_run_id=db.Database.unchanged,
                    state=db.Database.unchanged,
                    forced_run_requested=db.Database.unchanged):
    """"""
    job = self.cronjobs.get(cronjob_id)
    if job is None:
      raise db.UnknownCronJobError("Cron job %s not known." % cronjob_id)

    if last_run_status != db.Database.unchanged:
      job.last_run_status = last_run_status
    if last_run_time != db.Database.unchanged:
      job.last_run_time = last_run_time
    if current_run_id != db.Database.unchanged:
      job.current_run_id = current_run_id
    if state != db.Database.unchanged:
      job.state = state
    if forced_run_requested != db.Database.unchanged:
      job.forced_run_requested = forced_run_requested
814052
public function getCronjobs()
    {
        if (!$this->cronjobs) {
            $cronjobs = array();

            $results = $this->serviceLocator
                ->get('Application')
                ->getEventManager()
                ->trigger(__FUNCTION__, $this, array(
                        'cronjobs' => $cronjobs
                ));

            if ($results) {
                foreach ($results as $key => $cron) {
                    foreach ($cron as $id => $conf) {
                        $cronjobs[$id] = $conf;
                    }
                }
            }

            $this->setCronjobs($cronjobs);
        }

        return $this->cronjobs;
    }
105818
def get_jobs():
    """"""

    jobs = current_app.apscheduler.get_jobs()

    job_states = []

    for job in jobs:
        job_states.append(job)

    return jsonify(job_states)
584650
def list_jobs(tail):
    """"""
    query = (
        db.session.query(models.CrawlerJob)
        .order_by(models.CrawlerJob.id.desc())
    )
    if tail != 0:
        query = query.limit(tail)

    results = query.yield_per(10).all()
    _show_table(results=results)
1339193
def LeaseCronJobs(self, cronjob_ids=None, lease_time=None):
    """"""
    leased_jobs = []

    now = rdfvalue.RDFDatetime.Now()
    expiration_time = now + lease_time

    for job in itervalues(self.cronjobs):
      if cronjob_ids and job.cron_job_id not in cronjob_ids:
        continue
      existing_lease = self.cronjob_leases.get(job.cron_job_id)
      if existing_lease is None or existing_lease[0] < now:
        self.cronjob_leases[job.cron_job_id] = (expiration_time,
                                                utils.ProcessIdString())
        job = job.Copy()
        job.leased_until, job.leased_by = self.cronjob_leases[job.cron_job_id]
        leased_jobs.append(job)

    return leased_jobs
1203785
def Jobs(self):
        """"""
        url = self._url + "/jobs"
        return Jobs(url=url,
                    securityHandler=self._securityHandler,
                    proxy_url=self._proxy_url,
                    proxy_port=self._proxy_port,
                    initialize=True)
185284
public static function get_all_scheduled_tasks() {
        global $DB;

        $records = $DB->get_records('task_scheduled', null, 'component, classname', '*', IGNORE_MISSING);
        $tasks = array();

        foreach ($records as $record) {
            $task = self::scheduled_task_from_record($record);
            // Safety check in case the task in the DB does not match a real class (maybe something was uninstalled).
            if ($task) {
                $tasks[] = $task;
            }
        }

        return $tasks;
    }
1003405
def UpdateCronJob(self,
                    cronjob_id,
                    last_run_status=db.Database.unchanged,
                    last_run_time=db.Database.unchanged,
                    current_run_id=db.Database.unchanged,
                    state=db.Database.unchanged,
                    forced_run_requested=db.Database.unchanged,
                    cursor=None):
    """"""
    updates = []
    args = []
    if last_run_status != db.Database.unchanged:
      updates.append("last_run_status=%s")
      args.append(int(last_run_status))
    if last_run_time != db.Database.unchanged:
      updates.append("last_run_time=FROM_UNIXTIME(%s)")
      args.append(mysql_utils.RDFDatetimeToTimestamp(last_run_time))
    if current_run_id != db.Database.unchanged:
      updates.append("current_run_id=%s")
      args.append(db_utils.CronJobRunIDToInt(current_run_id))
    if state != db.Database.unchanged:
      updates.append("state=%s")
      args.append(state.SerializeToString())
    if forced_run_requested != db.Database.unchanged:
      updates.append("forced_run_requested=%s")
      args.append(forced_run_requested)

    if not updates:
      return

    query = "UPDATE cron_jobs SET "
    query += ", ".join(updates)
    query += " WHERE job_id=%s"
    res = cursor.execute(query, args + [cronjob_id])
    if res != 1:
      raise db.UnknownCronJobError("CronJob with id %s not found." % cronjob_id)
112680
def has_running_jobs(self) -> bool:
        """""""
        return self.jobs.exclude(status__status__in=ExperimentLifeCycle.DONE_STATUS).exists()
558465
public function listAction()
    {
        $this->performAccessChecks();

        $crons = $this->cronService->getCrons();

        return $this->render('SmileEzUICronBundle:cron:tab/crons/list.html.twig', [
            'datas' => $crons
        ]);
    }