DOI-USGS / mda.streams

backend tools for powstreams
Creative Commons Zero v1.0 Universal
3 stars 8 forks source link

add support for "archive" argument in post_ts #223

Closed jordansread closed 8 years ago

jordansread commented 8 years ago

For post_ts(on_exists="archive") we need to use the file rename of the old file, and post a new one:

https://github.com/USGS-R/sbtools/issues/188

Probably use an archive name and a date stamp for the old file?

aappling-usgs commented 8 years ago

sounds good. ideally/eventually we'd also have some way to retrieve an archived version in get_ts, maybe even by passing in a date range rather than a specific date stamp? updating all the data on SB can take several days, or at least did in the first go-round. probably worth at least considering when deciding on a naming scheme for archived files.

jordansread commented 8 years ago

adding

make_archive_name(basename(files[i]))
[1] "ARCHIVE_20160324_nwis_05406479-ts_doobs_nwis.tsv.gz"

but I wonder if the actual date stamp used should be the date it was originally posted, not the date it was archived? Not sure.

currently,

pkg.env$archive_id <- format(Sys.Date(),'%Y%m%d_')
aappling-usgs commented 8 years ago

i agree with using the original posting date if possible.

aappling-usgs commented 8 years ago

otherwise, naming scheme looks good to me. are you writing a parse_archive_name fun at the same time?

jordansread commented 8 years ago

yep, will do a parse_archive too

aappling-usgs commented 8 years ago

:+1: