-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# Microsoft 365 personal token | ||
# note: this is not a real token below, it will be hex | ||
microsoft365r_use_cli_app_id = abefc027egabb67a | ||
# note: this is not a real token below, real ones are hexadecimal | ||
microsoft365r_use_cli_app_id = abcdefg027ega67a | ||
# OneDrive My Way session file variables | ||
# NB: do not add the trailing slash | ||
# relative path to the staging folder | ||
ODMW_dest = stash_this | ||
# path to the oneDrive destination folder | ||
ODMW_dest = work_stuff | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
# oneDrive backup script | ||
# | ||
library(Microsoft365R) | ||
od <- get_personal_onedrive() | ||
od$upload_file("staging/Bayesian_primer.pdf", dest = "Bayesian_primer.pdf") | ||
od$upload_file("staging/cost_of_hope.pdf", dest = "cost_of_hope.pdf") | ||
uploads <- list.files(Sys.getenv("ODMW_staging")) | ||
paste("staged for upload: ", uploads[]) | ||
for (i in seq_along(uploads)) { | ||
od$upload_file(paste0(Sys.getenv("ODMW_staging") | ||
, "/" | ||
, stringr::str_trim(uploads[i])) | ||
, dest = paste0(Sys.getenv("ODMW_dest") | ||
, "/" | ||
, stringr::str_trim(uploads[i])) | ||
) | ||
} |