newcron Module

This file is part of the web2py Web Framework
Created by Attila Csipa <web2py@csipa.in.rs>
Modified by Massimo Di Pierro <mdipierro@cs.depaul.edu>

Cron-style interface

class gluon.newcron.Token(path)[source]

Bases: object

acquire(startup=False)[source]

Returns the time when the lock is acquired or None if cron already running

lock is implemented by writing a pickle (start, stop) in cron.master start is time when cron job starts and stop is time when cron completed stop == 0 if job started but did not yet complete if a cron job started within less than 60 seconds, acquire returns None if a cron job started before 60 seconds and did not stop, a warning is issue “Stale cron.master detected”

release()[source]

Writes into cron.master the time when cron job was completed

Returns an absolute path for the destination of a symlink

gluon.newcron.crondance(applications_parent, ctype='soft', startup=False, apps=None)[source]
class gluon.newcron.cronlauncher(cmd, shell=True)[source]

Bases: threading.Thread

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

class gluon.newcron.extcron(applications_parent, apps=None)[source]

Bases: threading.Thread

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

class gluon.newcron.hardcron(applications_parent)[source]

Bases: threading.Thread

launch()[source]
run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

gluon.newcron.parsecronline(line)[source]
gluon.newcron.rangetolist(s, period='min')[source]
class gluon.newcron.softcron(applications_parent)[source]

Bases: threading.Thread

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

gluon.newcron.stopcron()[source]

Graceful shutdown of cron