Files
stAndrews/data-raw/refresh_all.R
Rob Wiederstein 29f48172fb
Some checks failed
Deploy stAndrews / deploy (push) Failing after 16s
Refresh data, move logs to project dir, update docs
- Weekly refresh: 388 owners, 10 sales, 11 listings (2026-04-16)
- Move cron logs from ~/ to logs/ in each project dir
- Add logs/ to .gitignore and .dockerignore
- Update CLAUDE.md with log location and ops notes
- Update TODO.md with log relocation completion
2026-04-16 06:15:07 -04:00

40 lines
1.9 KiB
R

# refresh_all.R
# Weekly orchestrator. Downloads SCPA data files once, then updates
# owners and sales. Run via cron; container restart handled by cron.
options(timeout = 300)
cat("=== stAndrews weekly refresh", format(Sys.time()), "===\n")
# ── Download SCPA Public.xlsx ─────────────────────────────────────────────────
cat("Downloading SCPA Public.xlsx...\n")
download.file(
url = "https://www.sc-pa.com/downloads/SCPA%20Public.xlsx",
destfile = "./data-raw/property/SCPA Public.xlsx",
mode = "wb"
)
cat("Done.\n")
# ── Download SCPA_Parcels_Sales_CSV.zip ───────────────────────────────────────
cat("Downloading SCPA_Parcels_Sales_CSV.zip...\n")
download.file(
url = "https://www.sc-pa.com/downloads/SCPA_Parcels_Sales_CSV.zip",
destfile = "./data-raw/property/SCPA_Parcels_Sales_CSV.zip",
mode = "wb"
)
cat("Done.\n")
# ── Update owners ─────────────────────────────────────────────────────────────
cat("\n--- update_owners.R ---\n")
source("./data-raw/update_owners.R")
# ── Update sales ──────────────────────────────────────────────────────────────
cat("\n--- update_sales.R ---\n")
source("./data-raw/update_sales.R")
# ── Update listings ───────────────────────────────────────────────────────────
cat("\n--- update_listings.R ---\n")
source("./data-raw/update_listings.R")
cat("\n=== Refresh complete", format(Sys.time()), "===\n")