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:
copyis "upload what I have" (non-destructive).syncis "make destination match source" (can be destructive).moveis "transfer then remove source" (operationally risky if misused).
Behavior Summary
| Command | Adds new files | Updates changed files | Deletes destination extras | Removes source files |
|---|---|---|---|---|
copy | Yes | Yes | No | No |
sync | Yes | Yes | Yes | No |
move | Yes | Yes | Optional by mode | Yes |
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)
| Pattern | Direction |
|---|---|
rclone sync /local remote:path | Push |
rclone sync remote:path /local | Pull |
rclone sync remoteA:path remoteB:path | Remote 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
- Start with
--dry-run. - Enable logging (
--log-file,--log-level INFO). - 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
| Goal | Use | Notes |
|---|---|---|
| Upload artifacts without removing anything | copy | Best default for "publish" workflows |
| Keep a destination mirror of a source | sync | Use dry-run + logs + rollback |
| Drain a staging directory | move | Prefer copy + verify + delete if you need audit |
Common Pitfalls
| Pitfall | Consequence | Prevention |
|---|---|---|
Using sync for archival copy | Remote files disappear | Use copy for append-only archive paths |
Using move with unstable network | Partial job complexity | Use copy + verify + explicit cleanup |
| Skipping post-transfer check | Silent mismatch | Run rclone check after critical transfers |
Hands-On Practice
- Create a test directory with a few files.
- Run
copyto a test prefix. - Modify/delete a file locally.
- Run
sync --dry-runand 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