New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: simulate next event #94
Comments
Yeah, in fact I don't love the idea of anything initiated by a (And, really, it can't be a "proper" simulation, because the The idea of explaining what would be executed and when, that part's great. I'm all for that! Edit: (I was going to suggest that a method of simulating actual runs of the crontab entries would be to run |
When writing new cron files it's often nice to see what will actually happen when the next event in the crontab is reached. As far as I can tell there's no "simulation" option to make this happen.
What I propose is a new command line argument that requests that cron run any command(s) that would be due to execute at that precise moment in time, like this: cron --simulate . If you leave out it just runs the next command due to occur, and also prints the timestamp for the next even that would follow that one. Thus, if you wanted to simulate several events in a row, you would first do
cron --simulate
next task occurs in 3 hours and 5 minutes:
[next, the command would be run and the result sent to stdout]
and then finally cron would print
next event would be 2 days, 5 hours, and 1 minute later, at timestamp 341414211
this would allow you to continue the chain as far as you wanted.
obviously this would only run the events in the current user's crontab.
it might be nice to have the option of just printing out what the command would be, in addition to the option of actually executing the command. you could make that an interactive choice, since obviously this is not a feature that would be of use in scripts.
The text was updated successfully, but these errors were encountered: