Type: | Package |
Title: | Batch Script Helpers |
Version: | 0.1.0 |
Author: | Sherry Zhao |
Maintainer: | Sherry Zhao<sxzhao@gwu.edu> |
BugReports: | https://github.com/sherrisherry/batchscr/issues |
Description: | Handy frameworks, such as error handling and log generation, for batch scripts. Use case: in scripts running in remote servers, set error handling mechanism for downloading and uploading and record operation log. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
LazyData: | true |
NeedsCompilation: | no |
Packaged: | 2019-05-05 21:54:38 UTC; Admin |
Repository: | CRAN |
Date/Publication: | 2019-05-06 08:40:03 UTC |
Frame Work for Handling Errors in a Batch Process
Description
See arguments.
Usage
ecycle(code, ehandle, max_try, thandle, ecorrect, cond = TRUE)
Arguments
code |
The code block to run |
ehandle |
The code block to run when running |
max_try |
The number of attempts to run |
thandle |
(Optional) The code block to run when running |
ecorrect |
(Optional) The code block to run after running |
cond |
(Optional) Additional conditions for deciding that running |
Value
If running code
fails, the result of ehandle
.
If running code
succeeds and thandle
is missing, the result of code
.
If running code
succeeds and thandle
isn't missing, the result of thandle
.
Examples
ecycle({a <-1; print(a+b); b <- 2}, print('failed'), 3, print('succeeded'), b <- 3)
print(b)
Making Formatted Log Files
Description
See arguments.
Usage
mklog(x, path, sep = '\t')
Arguments
x |
Content of a log record. |
path |
The path of the log file, if ”, the log record is sent to standard output. |
sep |
The seperator in a record. |
Value
None (invisible NULL)
Examples
mklog('test log', '')