agentleFS
hsigstadhsigstad/research-kit/skills/backup/SKILL.md

backup

Skill0 starsChanged 4 months agoMITView on GitHub

Back up expensive-to-regenerate pipeline/project artifacts to Dropbox with the right format and location. Use when the user wants to offload, back up, or archive data to Dropbox — a corpus, a cache, scraped raw, or a whole pipeline's build outputs.

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use restore and update.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • nikosdionSkill

    restore

    Restore a Joomla or WordPress site backup created by Akeeba Backup (Joomla/WordPress) or Akeeba Solo using Akeeba Kickstart and the Akeeba Backup Restoration Script, including multipart archive handling, restoration configuration, and post-restore cleanup.

    Also in 4 projects that use this

  • AnthropicSkill

    update

    Sync tasks and refresh memory from your current activity. Use when pulling new assignments from your project tracker into TASKS.md, triaging stale or overdue tasks, filling memory gaps for unknown people or projects, or running a comprehensive scan to catch todos buried in chat and email.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Beware mid-build races: If the pipeline is still writing, files added after your enumeration are missed — re-scan and rclone copy the delta …

    line 68
  2. Distinctive:

    Commit catalog + skill changes (standing authorization).

    line 94

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Back up data to Dropbox

Disaster-recovery copies of expensive-to-regenerate artifacts (scraped corpora, LLM caches, geoblocked raw PDFs, BigQuery exports). Dropbox is a cold backup, not a working store. For ad-hoc file sharing / browsing, use the dropbox skill instead.

Writable remotes exist only on the host (bi-dropbox:), not the sandbox (*-ro: only). Stage compressed archives on /projects (has TBs free), not /tmp.

The two decisions: FORMAT and LOCATION

FORMAT — keyed on file count/size, not one-size-fits-all

The dividing line is Dropbox's too_many_write_operations failure (bursts of many small files). Pick by artifact shape:

ShapeFormWhy
Corpus: hundreds–low-thousands of medium/large files (parquet, MB–GB each)Per-file, recompressed to ZSTD-9, mirroring the local treeDirectly readable + partial restore; rclone copy gives free incremental sync; ZSTD-in-parquet beats tar-of-snappy (a real case: 44 GB SNAPPY → 18 GB ZSTD vs 34 GB tar.zst)
Tiny-file cache: 10k–100k files, few KB each (LLM caches)Single tar.zstPer-file trips the write-op limit; FS block-slack inflates size (a "1 GB" cache was 411 MB of data across 63k files → 20 MB zstd)
Bulk incompressible: 10k+ PDFs/imagestar with zstd -3 (combine, don't compress)Compression won't help; combining dodges the write-op limit

Rule of thumb: per-file is strictly better until files get too many/too tiny (~a few thousand medium files is the comfortable ceiling), then you must combine. Already-compressed files (.zip, .pdf) at low count → upload per-file as-is (don't re-compress). ZSTD-9 is the sweet spot; level 19 is ~27× slower for a few %.

LOCATION — ownership/consumption, NOT "produced by a pipeline"

Fetching ≠ owning. Decide by who reads it:

  • bi-dropbox:data/<x>/ — the shared data lake: raw inputs read across many projects (TSE, cnpj, court corpus) and deliberate cross-cutting namespaces (data/TCEs/ for all TCE state pulls, data/mides/ for the shared procurement bulk). These stay in data/ even if one pipeline scraped them.
  • bi-dropbox:pipelines/<slug>/ — artifacts owned and consumed by only that pipeline: its build/ outputs and its own scrape/LLM caches nothing else reads. Build outputs → pipelines/<slug>/build/...; caches → pipelines/<slug>/ root.

Do NOT blanket-move data/ → pipelines/. Most of what a pipeline "produces" into data/ is shared raw. Match the existing sibling's layout (e.g. new TCE state pull → mirror the other data/TCEs/tce_<state>/ dirs).

Workflow

  1. Assess shape. du -sh, find <dir> -type f | wc -l, extension breakdown, and for parquet check the codec (pq.ParquetFile(f).metadata...compression). Choose FORMAT + LOCATION from the tables above.
  2. Check for prior backups first. List the destination and siblings — a previous session may already have offloaded it (possibly under a different name/layout). Reconcile before duplicating; surface (don't silently delete) anything you didn't create that overlaps.
  3. Compress if needed.
    • Corpus → recompress to ZSTD parquet with the bundled helper: python recompress_zstd.py --src <clean> --dst <clean_zstd> (serial, resumable; see its header for the OOM/deadlock gotchas). Verify row counts match a sample.
    • Cache/PDF → tar -C <parent> -cf - <dir> | zstd -<L> -T3 -o <name>_<startYr>-<endYr>.tar.zst then zstd -t to verify. Name archives by time coverage.
  4. Upload. rclone copy -P --transfers 4 --checkers 8 <local> <remote> (copy never deletes on remote; reserve sync for the user, with --dry-run first).
  5. Verify. rclone check <local> <remote> (0 differences) or compare rclone size file counts + bytes. Small byte deltas = dir-inode accounting, not content.
  6. Beware mid-build races. If the pipeline is still writing, files added after your enumeration are missed — re-scan and rclone copy the delta (it's cheap).
  7. Update the data catalog ($ROOT/data_catalog/, hand-curated — edit _annotations/datasets/<x>.yaml storage.backup and the matching DATA_CATALOG.md section; do NOT regenerate). Validate: .venv/bin/python scripts/validate_annotations.py.
  8. Record in memory what was non-obvious (new location, a gotcha, an audit result).

Auditing for stranded local-only data

To find artifacts that were never offloaded: reconcile local scrape/build dirs against the remote. Compare by archive/coverage, NOT raw file count — a dir of 44k loose zips correctly backed up as 2 consolidated tars will falsely look like a 44k→2 "gap". Where remote count > local, that's usually extra older pulls, not a gap. Confirm true gaps (local > remote in coverage) before uploading.

Restore

  • Per-file parquet: rclone copy <remote-dir> <local> (or rclone cat one file).
  • Archive: rclone cat <archive> | tar -x{--zstd or z}f - -C <parent>.

Gotchas

  • too_many_write_operations fires on bursts of many files — combine into few archives.
  • Foreground sleep may be blocked in-session; use background jobs / Monitor to wait.
  • rclone move leaves empty dir markers — clean with rclone rmdirs.
  • Commit catalog + skill changes (standing authorization); confirm before any purge/force.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.