run.Job: Runs the job

Description Usage Arguments Details Value Author(s) References See Also


Runs the job.


## S3 method for class 'Job'
run(this, reset=FALSE, sink=TRUE, ...)



If TRUE, job is first reset, otherwise not.


If TRUE, all output is sinked to a file, otherwise not.


Not used.


First the job is locked. Then *setup() is called, and the current working directory is set to the job path, that is, any script or functions calls are evaluated within the job directory. Then the handle method onStart() followed by onRun() are evaluated with this object as the first argument. If an error occurs while evaluating these, it is caught and onError() is evaluated. Similar, if an interrupt, that is Ctrl-C (SIGINT), occurs it is caught and onInterrupt() is evaluated. Finally, handle method onFinally() is (always) evaluated. Errors or interrupts occuring while evaluating this latter method, will not call onInterrupt() and onError(), respectively.

Note also, that if errors or additional interrupts occurs while evaluating onInterrupt() or onError() these will not be caught. This can be an issue if for instance the user holds down Ctrl-C. Unfortunately, there is no solution to the problem at the moment [1].


Returns a TRUE if job finished successfully, otherwise FALSE.


Henrik Bengtsson (


[1] H. Bengtsson, Exception handling in R, 2004.

See Also

*lock(). *setup(). *isExisting(). *isStarted(). For more information see Job.

R.batch documentation built on May 31, 2017, 2:43 a.m.