Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 627 Bytes

README.md

File metadata and controls

38 lines (28 loc) · 627 Bytes

lcron

unix like cron bindings for lua

build

sample

local lcron = require("lcron")

lcron.add("name1", "* * * * * *", function()
    print("hello cron!\n")
end)

lcron.add("name2", "* * * * * *", function()
    print("hello cron2!\n")
end)

lcron.delete("name2")

-- wait for 1 sec
local now = os.time()
while now == os.time() do
    -- spin
end

lcron.update()

lcron.delete("name1")
lcron.delete("name666") -- not exist

license

no license, any way you want.