agentleFS
iberi22iberi22/skills/skills/devops/rclone-drive-backup/SKILL.md

rclone-drive-backup

Skill0 starsChanged 36 days agoMITView on GitHub

Use when uploading local trees to Google Drive.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Check % complete of an in-flight rclone upload

    line 19
  2. Very specific:

    Run from the SAME root the sync uses, or / patterns match differently and the check is worthless.

    line 49
  3. Very specific:

    Do NOT pipe the long command through tail: tail buffers until the pipe closes, so process polls show zero progress for hours.

    line 62
  4. Very specific:

    Never commit secrets: rclone.conf contains OAuth tokens — redact token/client_secret in any output you show.

    line 95

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Rclone Drive Backup

When to use

Load this skill when the user asks to:

  • Upload, sync, or snapshot local directories to Google Drive via rclone
  • Refresh md-plain mirrors, tree copies, or snapshots/ tarballs on Drive
  • Check % complete of an in-flight rclone upload
  • Debug why a Drive destination is stale or missing

Procedure

1. Pre-flight: remote health + what is already there

rclone lsd gdrive: --max-depth 2          # remote reachable?
rclone about gdrive:                        # quota headroom?
rclone lsl gdrive:SWAL/snapshots/ | tail    # date of last snapshot upload
rclone lsd gdrive:SWAL/tree/apps/           # date of last tree sync
rclone lsd gdrive:SWAL/md-plain/            # 'directory not found' = mirror never ran

Compare remote dates against local scope before choosing full vs incremental: a mirror dir that does not exist means that pipeline stage never completed, not that it is up to date.

2. Verify the filter file BEFORE uploading

rclone lsf is NON-recursive by default — a bare lsf shows only top-level entries and hides what the filter really passes. Always verify with:

cd <same-root-the-sync-runs-from>
rclone lsf -R --files-only <source-root> --filter-from <filter-file> | wc -l
rclone lsf -R --files-only <source-root> --filter-from <filter-file> | grep -v '<allowed-extension>$' | head

Run from the SAME root the sync uses, or **/ patterns match differently and the check is worthless. The second command must print nothing: any non-allowed extension in output means the filter leaks.

3. Launch long uploads in background and confirm liveness immediately

Launch with terminal(background=true, notify=true), then poll the session at once: background launches can die silently, and a missing process only shows up if you check. Capture the session_id — it is the only handle for later polls.

4. Monitor via pgrep + remote listing, never via piped output

Do NOT pipe the long command through tail: tail buffers until the pipe closes, so process polls show zero progress for hours. Monitor instead with:

pgrep -af "rclone copy" | grep -v hermes-snap   # in-flight transfer = current repo
rclone lsd gdrive:SWAL/md-plain/ | wc -l         # completed units

5. Report % as completed-units / total-units + current unit + ETA

ls -d <local-source>/*/ | wc -l    # total units

Heavy repos stall the % for a long time while the process is healthy — report the in-flight repo name and ETA alongside the %, not the % alone. Answer repeated "que % falta?" checks with fresh remote listings, never from memory of the last check.

6. Completion evidence (all required before claiming done)

  • Background process exited (poll shows completed, or pgrep empty).
  • Fresh (today) timestamps in EVERY destination stage (rclone lsl on snapshots, rclone lsd on mirrors).
  • Report: files/bytes transferred per stage + remote paths.

Standing gates

  • Gate multi-GB rclone syncs on unmetered network. On mobile/metered data, run snapshot (tarball) uploads only, or ask first — bulk small-file syncs are throttled to KiB/s and burn the data budget. When the user announces wifi is back, update the network-regime memory entry the same turn the upload is re-enabled.
  • Never commit secrets: rclone.conf contains OAuth tokens — redact token/client_secret in any output you show.

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.