Skip to content

rsync: recursive mirroring between local and remote #38

Description

@lionello

There's no way to mirror a tree. cp -R exists but is one-shot and one-directional (remote → local only), re-downloads everything on every run, and has no delete/prune.

Proposed: onedrive rsync [-n] [-r] [--delete] SOURCE DEST, using the same ./ and :/ prefixes as cp/mv.

Building blocks:

  • SHA1 comparison to skip unchanged files — cp: skip the transfer when the SHA1 already matches #36
  • recursive enumeration — cp_paged() / findItems()
  • GET /drive/root/view.delta for cheap "what changed remotely", with the delta token persisted between runs
  • fileSystemInfo set at upload time so local mtimes survive the round trip

The last two are internal to this command. #43 and #52 are closed as not planned because the user-facing delta and touch verbs aren't wanted — that doesn't block using the same endpoints as plumbing here.

Open questions worth settling before implementing:

  • one-way (local → remote, remote → local) only, or bidirectional?
  • --delete semantics, given remote deletes are recursive and land in the recycle bin
  • where the delta token lives — alongside the auth token in $XDG_STATE_HOME?

Starting one-way with -n/--dry-run and no --delete would already cover most of the value.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions