Skip to main content

Copy, Sync, and Move

Rclone's three core transfer commands look similar but behave very differently.

Learning Focus

Use this lesson to choose the correct transfer command for the job and to learn a safe execution pattern for production.

Concept Overview

Think of these commands as three policies:

  • copy is "upload what I have" (non-destructive).
  • sync is "make destination match source" (can be destructive).
  • move is "transfer then remove source" (operationally risky if misused).

Behavior Summary

CommandAdds new filesUpdates changed filesDeletes destination extrasRemoves source files
copyYesYesNoNo
syncYesYesYesNo
moveYesYesOptional by modeYes
warning

sync mirrors source to destination and can delete remote files. Run --dry-run before real execution.

Basic Syntax

rclone copy SRC DST [flags]
rclone sync SRC DST [flags]
rclone move SRC DST [flags]

Direction Matters (Push vs Pull)

PatternDirection
rclone sync /local remote:pathPush
rclone sync remote:path /localPull
rclone sync remoteA:path remoteB:pathRemote to remote

Canonical Examples

copy-example.sh
rclone copy /srv/media remote-prod:archives/media --progress
sync-example.sh
rclone sync /srv/media remote-prod:archives/media --dry-run
rclone sync /srv/media remote-prod:archives/media --progress
move-example.sh
rclone move /srv/export remote-prod:dropzone/export --progress

Production-Safe Execution Pattern

Step 1: Preflight (Prevent Empty-Source Incidents)

preflight.sh
test -d /srv/media || { echo "missing source"; exit 1; }
test "$(ls -A /srv/media | wc -l)" -gt 0 || { echo "source empty"; exit 1; }
rclone lsd remote-prod:archives >/dev/null

Step 2: Dry Run (Preview What Will Change)

rclone sync /srv/media remote-prod:archives/media --dry-run -vv --log-file /var/log/rclone-dryrun.log

Step 3: Execute With Logs

rclone sync /srv/media remote-prod:archives/media --progress --log-level INFO --log-file /var/log/rclone-sync.log

Step 4: Verify

rclone check /srv/media remote-prod:archives/media --one-way --log-file /var/log/rclone-check.log

Safe Execution Pattern

  1. Start with --dry-run.
  2. Enable logging (--log-file, --log-level INFO).
  3. Only then run without --dry-run.
info

If you need rollback for destructive syncs, learn --backup-dir in the next module: Delete Modes and Backup Dir.

Validation Commands

rclone lsl remote-prod:archives/media
rclone check /srv/media remote-prod:archives/media --size-only

Choosing the Right Command

GoalUseNotes
Upload artifacts without removing anythingcopyBest default for "publish" workflows
Keep a destination mirror of a sourcesyncUse dry-run + logs + rollback
Drain a staging directorymovePrefer copy + verify + delete if you need audit

Common Pitfalls

PitfallConsequencePrevention
Using sync for archival copyRemote files disappearUse copy for append-only archive paths
Using move with unstable networkPartial job complexityUse copy + verify + explicit cleanup
Skipping post-transfer checkSilent mismatchRun rclone check after critical transfers

Hands-On Practice

  1. Create a test directory with a few files.
  2. Run copy to a test prefix.
  3. Modify/delete a file locally.
  4. Run sync --dry-run and confirm you understand the planned changes.
practice.sh
mkdir -p /tmp/rclone-lab && echo "hello" > /tmp/rclone-lab/a.txt
rclone copy /tmp/rclone-lab remote-prod:labs/rclone-lab --progress
rm /tmp/rclone-lab/a.txt
rclone sync /tmp/rclone-lab remote-prod:labs/rclone-lab --dry-run -vv

What's Next