crontime: Test a cron job by writing the comext folder name to a text...

Description Usage Arguments Details See Also Examples

View source: R/crontime.R

Description

This script waits a random number of seconds, then scraps the most recent comext folder name and the name of the last file in that folder. The ouput is written to a log file.

Usage

1
crontime(logfile, randomsleeptime)

Arguments

logfile

character path to a log file

randomsleeptime

integer maximum number of second to wait before checking the comext website.

Details

To run this script every day at 3:00 am, edit the crontab file

sudo vim /etc/crontab

and enter the following command:

0 2 * * * debian Rscript -e "tradeharvester::crontime(logfile = '/mnt/sdb/public/log/crontime.txt', randomsleeptime = 3600)"

The log file can be located in a publicly accessible web folder.

See Also

harvest, the main harvesting function run as a cron job.

Examples

1
2
3
templog <- tempfile(fileext = ".txt")
crontime(logfile = templog, randomsleeptime = 0)
readLines(templog)

stix-global/eutradeflows documentation built on Nov. 13, 2020, 9:23 p.m.