Show HN: Crondom
crondom.com
crondom.com
Please try to break it since it is really fresh. I should have the /etc/init.d stuff and a while true; do bash script set up, so it should come back if it crashes. I would like to have it not crash, but if it does, then things should come back online. It is using https://github.com/mathgladiator/win and https://github.com/mathgladiator/servy
I honestly don't have any idea what it does. All I know is that it does something in configurable intervals. I guess some additional info on the site would be helpful :)
You can also break up a cron job into # of clients. This enables you to process reasonable large # of clients by giving each client a URL to go with rather than doing the work at the moment. For instance, you want to pull 1000 user twitter feed every day. Well, if it takes 1 second, then you have 1000 seconds of work for the script, or 16 minutes. Most developers are forced to live within 30 seconds per request.
In this same scenario, what happens when it fails for user 377? what happens for 378? Handling errors is not always straight forward especially from a business case. Ideally, crondom will enable us to graph for failure cases (coming soon) and isolate which part of the cron task failed.
There are many more developer-run companies today than there were 10 years ago and the number will continue to grow. There have never been more opportunities to do that than right now.
To be fair, it's a solid idea that I imagine would do well regardless of the name. To continue being fair, it's hard to picture the name not being a point of friction in at least some scenarios For instance, picking the name out of a list of possible choices. There are unfortunately likely more limiting scenarios than that.
Seriously though, sounds easy to use, if perhaps a bit overpriced for something I’d mostly want to use on small or personal projects.
I thought you could just do:
*/7 * * * * whatever...Are there any specific app requirements in running 7min or 17sec?
watch -n 17 -p command
Make a wrapper to run command in the background (&) if the process runtime is greater than your interval.
screen -dmS 17secondjob perl -Mthreads -e 'while(1){threads->create(sub{`run the command`})->detach();sleep 17}'
7, 14, 21, 28, 35, 42, 49, 56,(11 min gap), 7, 14, etc
Crondom would run: 7, 14, 21, 28, 35, 42, 49, 56, 3, 10, 17, 24, ..., n+7
OP correct me if I'm wrong with the intention of that bullet point.0-56/7 0-21/7 * * * Command
3-59/7 1-22/7 * * * Command
6-55/7 2-23/7 * * * Command
2-58/7 3-17/7 * * * Command
5-54/7 4-18/7 * * * Command
1-57/7 5-19/7 * * * Command
4-53/7 6-20/7 * * * Command
Of course, the last job would finish at 23:55, and the next start at 00:00 which is bad. So you'd need to do it on a per day basis. Luckily there are 7 days in the week. So you would just need to write those 7 jobs above on a per day basis. You'd end up with 49 jobs all looking similar to this:
0-56/7 0-21/7 * * Wed Command
0,8,16,24,32,40,48,56 0,2,4,6,8,10,12,14,16,18,20,22 * * * cmd
4,12,20,28,36,44,52 1,3,5,7,9,11,13,15,17,19,21,23 * * * cmd
This starts to get a bit silly when the interval isn't a factor of 24 though.That is a Linuxism. I found out the hard way setting up some Solaris 9 scripts last summer.
http://crondom.com/documentation
(very hastily written)