# rcx — rclone, dressed
`rcx` is the cloud-transfer half of the pair whose other half is [`rsx`](RSX.md).
`rsx` moves files *into a mounted folder*; `rcx` talks to the remote directly and
never touches a mount. Installed in `~/.local/bin`, standard library only, using
the shared `ricefx` palette. Card: `rcx-cheat` (also in `xcheats`).
```sh
rcx ~/Documents/Notes gdrive:Notes # upload
rcx gdrive:Notes ~/Documents/Notes # download
rcx preview ~/Pictures gdrive:Pictures # dry run + hardlink cost
rcx job "/mnt/ssd/Media/Video Library" gdrive:Backup/Media
rcx jobs · rcx watch 08-creator-libraries · rcx stop 08-creator-libraries
rcx check ~/Pictures gdrive:Pictures # verify
rcx-cheat
```
Paths are local paths or `remote:path` — `gdrive:Backups/2026`, no leading slash.
`copy` is the default mode and deletes nothing.
## Why not through the mount
A `~/GDrive` transfer is really a transfer through rclone's VFS cache, which on
this machine is capped at 8 GiB and lives on the same disk you are copying from.
For anything bigger than the cache that is slower and riskier than going to the
remote. So `rcx` **refuses** a path that resolves inside a cloud FUSE mount and
tells you the `remote:path` to use instead:
```
rcx: /home/daemon-sec/GDrive/Notes is inside the cloud mount /home/daemon-sec/GDrive.
Bulk transfers through a mount crawl through its VFS cache.
Use the remote directly, e.g. <remote>:Notes
(or pass --no-guard if you really mean the mounted path)
```
Detection reads `/proc/self/mountinfo` and matches `fuse.rclone`, the other cloud
FUSE drivers, and plain `fuse` mounts whose source is pCloud, Dropbox, MEGA or
Insync. `fuse.gocryptfs` and sshfs are excluded — nothing is wrong with copying
into those. `--no-guard` overrides it; the mount is still the right tool for
browsing, streaming and small interactive edits.
## Defaults
Every transfer gets `--transfers=4 --checkers=8 --fast-list`, plus
`--drive-stop-on-upload-limit` when either endpoint is a Google Drive remote
(rcx reads the type from your own rclone config). Interactive runs add
`--progress`; detached jobs use `--stats=30s --stats-one-line` so the journal
stays readable. Anything you pass yourself goes to rclone unchanged, and
everything after `--` is rclone's alone.
## Modes
| mode | what it does |
| --- | --- |
| `copy` (default) | copy/update to the far side; nothing is deleted |
| `preview` | `--dry-run`, plus a report of what your hardlinks would cost |
| `mirror` | `rclone sync` — deletes destination-only files. Needs `--yes` |
| `move` | uploads, then deletes each source file that arrived. Needs `--yes` |
| `job` / `jobs` / `watch` / `stop` | detached transfers (below) |
| `check` | `rclone check --one-way`; `--both` also reports extras |
| `ls` / `size` / `about` / `remotes` | browsing and quota |
| `mount` / `unmount` | the `rclone-*.service` mount units |
| `raw` | exact rclone invocation, no defaults, no decoration |
`mirror` and `move` are the two that destroy something, so both refuse without
`--yes`. `rcx` flags (`--yes --command --plain --no-guard --name`) are recognised
anywhere in the line, so `rcx job --command …` reads the same as
`rcx --command job …`.
## Long uploads
`rcx job` runs the copy as a transient systemd user unit, so it survives closing
the terminal:
```sh
rcx job --name media "/mnt/ssd/Media/Video Library" "gdrive:Backup/Media"
rcx jobs # every rcx job and its state
rcx watch media # journalctl -f on that unit
rcx stop media # end it; re-running the job resumes it
```
Nothing is redone on a resume — `copy` skips what already arrived. Local paths
are made absolute before the unit is created, because a systemd unit does not
inherit your shell's working directory. Your account has lingering enabled, so
jobs keep running across logout. A failed unit stays visible until
`systemctl --user reset-failed rcx-<name>`.
## Installed services
`rcx job` is one detached run that is gone when it ends. For something that
should happen again — a nightly upload, a folder that syncs at every login —
`rcx service` writes real unit files into `~/.config/systemd/user/`:
```sh
rcx service create --schedule daily --name notes ~/Documents/Notes gdrive:Notes
rcx service create --name media --boot "/mnt/ssd/Media/Video Library" gdrive:Backup/Media
rcx service create --now SRC DEST # install and start it right away
rcx service create --command … # print the unit files, write nothing
rcx service list · rcx service show notes · rcx service rm notes
```
A scheduled service gets `rcx-<name>.service` plus `rcx-<name>.timer`, and the
timer is enabled for you. `--boot` installs the service under `default.target`
instead. With neither, the unit is installed but only runs when you start it.
`rcx watch <name>` and `rcx stop <name>` work on services exactly as they do on
jobs, and `rcx jobs` lists both.
The generated service:
```ini
# managed by rcx — rcx service rm notes
[Unit]
Description=rcx copy: /home/daemon-sec/Documents/Notes -> gdrive:Notes
Documentation=https://rclone.org/commands/rclone_copy/
[Service]
Type=oneshot
ExecStart=/usr/bin/rclone copy --transfers=4 --checkers=8 --fast-list \
--drive-stop-on-upload-limit --stats=30s --stats-one-line \
/home/daemon-sec/Documents/Notes gdrive:Notes
# A transfer may run for hours; the default start timeout would kill it.
TimeoutStartSec=infinity
Nice=10
IOSchedulingClass=idle
UMask=0022
```
`TimeoutStartSec=infinity` is not decoration: this user manager's
`DefaultTimeoutStartUSec` is 90 seconds, and a `Type=oneshot` unit that outlives
it is killed mid-transfer. `Nice=10` and `IOSchedulingClass=idle` keep a long
upload from crowding out interactive work. Timers carry `Persistent=true`, so a
run missed while the machine was off happens at the next boot, and
`RandomizedDelaySec=15min` keeps several timers from firing together. Both unit
types pass `systemd-analyze --user verify`.
Every generated file starts with `# managed by rcx`. rcx refuses to overwrite or
delete a unit without that line, so a hand-written service — `rclone-gdrive.service`,
say — is never touched. Replacing one of rcx's own units needs `--force`.
`rcx service rm` disables the unit, removes both files, reloads the manager and
clears any failed state.
Mount units are written the same way, modelled on the same VFS settings:
```sh
rcx mount create gdrive ~/GDrive --now # writes rclone-gdrive.service
rcx mount # list units, mountpoints and state
rcx mount gdrive · rcx unmount gdrive # start / stop
```
`rcx mount <name>` checks the mountpoint before starting: a non-empty directory
is refused with the reason, because rclone will not mount over your files and
those files are local, not in the cloud.
## Hardlinks cost real upload
rclone has no concept of a hardlink: every path is uploaded as its own file. A
library with a hardlinked index folder therefore costs far more on the wire than
`du` suggests. `rcx preview` measures it before you pay:
```
hardlinks: 115.2 GiB of 477.6 GiB would upload more than once
exclude the index folder to send each file once
```
Upload the real folder and exclude the index (`--exclude 'index/**'`), or
accept the duplication knowingly.
## Quotas
Google Drive accepts 750 GB of uploads per account per day. With
`--drive-stop-on-upload-limit` (on by default for drive remotes) rclone stops
cleanly at the limit instead of erroring through the rest of the queue; run the
same job again the next day to continue.
## Verifying
```sh
rcx check "/mnt/ssd/Media/Video Library" "gdrive:Backup/Media"
```
Size and hash, one way by default: it reports what is missing or wrong on the far
side and ignores extra files there. `--both` also flags extras, `--download`
re-downloads for remotes without hashes, and `-L` matters when the upload
followed symlinks (an `rsx cloud` copy did, so its verification needs it).
Test suite: `python3 ~/.dotfiles/scripts/tests/rcx.test.py` — every transfer in
it stays inside a temporary directory.