Feature #277

houskeep and cron package for enduro/x user app

Added by Madars about 6 years ago. Updated about 6 years ago.

Status:NewStart date:02/02/2018
Priority:Normal (Code 4)Due date:
Assignee:-% Done:

0%

Category:-
Target version:-

History

#1 Updated by Madars about 6 years ago

This can be written in go.

Cron package: https://github.com/robfig/cron

the file mover & archiver could written in go too.

#2 Updated by Madars about 6 years ago

[@hkeep/1]
scan_folder=${NDRX_APPHOME}/log
scan_mask=.*
target_folder=${NDRX_APPHOME}/arcdbg
reqfile_finish=60s
reqfile_mask=
reqfile_folder=${NDRX_APPHOME}/log/req
compress_command=tar -xzf $[filename] $[filename]
# Remove old housekeep records
recycle_exec=cp $[filename] /to/archive
recycle=120d

INI:
[@excron]
sched load_bins = { "sched": "0 3 * * *", "command":"${NDRX_APPHOME}/bin/som_bin1", "dupstrategy":"skip" , cctag="HELLO/TAG", env1="SOME_ENV:SOME_VALUE",...env10 }
sched housekeep = { "sched": "0 4 * * *",  "command":"${NDRX_APPHOME}/bin/hkeep", "dupstrategy":"ignore" }

xadmin commands:

ndrx> cron print - list all schedules, when run expected
ndrx> cron stop [-s schedule_name] - stop cron ops (server keeps running). Allow to disable particular schedule.
ndrx> cron reload - load new config for cron ? If possible
ndrx> cron start [-s start_schedule]- start particular schedule or full scheduler
ndrx> cron wait [-s schedule]-  wait for existing jobs to finish. This shall perform periodic pings on "@EXCRON001" to wait for tasks to finish. with -s full schedule may be specified.

The cron server shall contain cluster node id in the name. So that in future we might address other node crons.

Go library cron: https://github.com/robfig/cron

Also available in: Atom PDF