Skip to main content

Paths and Remote Syntax

Rclone targets are either local filesystem paths or remote paths using remote:path syntax.

Learning Focus

Most destructive incidents come from targeting the wrong destination. This lesson gives you a checklist to prove your SRC/DST are correct.

Syntax Rules

PatternMeaningExample
/local/pathLocal source or destination/srv/uploads
remote:Remote roots3-prod:
remote:path/to/dirRemote subpaths3-prod:site/uploads
:s3,env_auth:true:bucket/pathBackend-on-the-fly:s3,provider=AWS:my-bucket/app

Examples

# local -> remote
rclone copy /srv/data s3-prod:backup/data

# remote -> local
rclone copy s3-prod:backup/data /restore/data

# remote -> remote
rclone sync b2-prod:daily r2-prod:daily

A Safe Targeting Checklist

Before any sync:

  1. Confirm the source directory is mounted and non-empty.
  2. Confirm the destination prefix is the intended one.
  3. Do a --dry-run -vv and scan the planned delete list.
targeting-checks.sh
test -d /srv/data || exit 1
test "$(ls -A /srv/data | wc -l)" -gt 0 || exit 1
rclone lsd s3-prod:backup >/dev/null
rclone sync /srv/data s3-prod:backup/data --dry-run -vv
tip

Use explicit paths instead of remote roots in production jobs. remote: is easy to mistarget.

Quoting and Spaces

rclone copy "/srv/notion-export/rsync markdown" "s3-prod:knowledge/rsync markdown"
note

If you can avoid spaces in destination prefixes, do it. It reduces quoting mistakes in automation.

Verification Pattern

# inspect destination before transfer
rclone lsd s3-prod:backup

# inspect result after transfer
rclone tree s3-prod:backup/data --max-depth 2

Common Targeting Mistakes

MistakeWhat it looks likeSafer alternative
Sync to remote rootremote-prod:Use remote-prod:backups/app/current
Mixed environment remotesprod source to staging destinationUse explicit env names in remote
Relative local paths in cron./dataUse absolute paths (/srv/data)

Common Pitfalls

PitfallSymptomFix
Missing remote prefixCommand runs locally by mistakeUse remote:path explicitly
Wrong bucket pathFiles end up in rootSet and test exact destination path
Spaces not quotedPath splitting errorsAlways quote paths with spaces

What's Next