Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
If you want to do easy restart properties for failed jobs, logging @ARGV will not help you. At least, I have cases where there is a distinct difference, passing time, which makes reusing the exact command line switches unfeasible in my case. I have lots of "convenience" command line switches, mostly used for crontab entries which select reporting dates:
Of course, if such a job has failed, restarting it with that command line is not useful as the prev-workday now may well be a different date than what it was when the job failed. To solve this problem, I have come to the pattern of logging the parameters of the "main subroutine" for the job for restarting. The main subroutine must be called with what I call "effective parameters", that is, no more relative dates but only absolute information:
generate_report then logs its parameters for easy restarting, and in the case of an error usually outputs a command line that can be pasted verbatim into a console session verbatim to restart the job. In reply to Re: What are (popular) modules that access/modify @ARGV?
by Corion
|
|