This function searches a log file, such as those created with job_single()
,
for the start and end dates for the SGE job. This information can then be
used to find the qacct
file to retrieve information about the job at hand.
log_date(log_file, tz = "EST", date_lines = c("Job starts", "Job ends"))
The path to a SGE log file.
Time zone for your SGE cluster. Defaults to EST
for JHPCE.
A character(2)
vector with the start and end text lines
used for detecting the start and end times of the job.
A vector of length 2 with the start and end times
Only the first occurrenses of the start and end time line identifiers
defined by date_lines
will be retrieved.
## Example log file
bsp2_log <- system.file("extdata", "logs", "delete_bsp2.txt", package = "sgejobs")
## Find start/end dates
log_date(bsp2_log)
#> start end
#> "2019-09-07 14:40:21 EST" "2019-09-07 14:40:59 EST"
## Another example log file
twas_gene_HIPPO <- system.file("extdata", "logs",
"compute_weights_full_HIPPO_gene.1.txt",
package = "sgejobs"
)
log_date(twas_gene_HIPPO)
#> start end
#> "2019-08-12 16:35:41 EST" "2019-08-12 16:35:46 EST"