Arkiv för nörderier

A time-travel tool for Linux-based testing of scheduled jobs

Posted in nörderier with tags , , on 2014-02-19 by Kristian

In case it is useful for anyone, I searched for something similar and did not find it, so I hacked it together.


A tool to do a controlled "time-warp" on a Linux box.


Assume that you have a system that perform events at a known
time, e.g. through cron jobs. Testing that system can be
very frustrating if some of the events are infrequent, 
for example yearly, combined with more frequent events, 
for example hourly.

Moving time manually is boring, and error prone.

This tool consumes a crontab-like file and moves time in
a controlled way, stopping a few seconds before the next
event start, pausing (will possibly be changed to a more
intelligent method later) for a while, then optionally
continue with the next event. 

The "command" part of the crontab (see example) is right now
used as informational trace only.


warp, without argument, execute the next event.

warp --to "YYYY-MM-DD hh:mm", execute all events between now
and the specified time. Stops at the last executed event.



%d bloggare gillar detta: