Skip to main content

rclone Moveto

rclone moveto moves a source file or directory to a specific destination path, deleting the source after successful transfer. Like copyto, it allows renaming during the transfer — but unlike copy, the source is removed.

Source Removed After Transfer

The source file is deleted once the transfer is verified. This is not reversible — ensure the destination is correct before running.

Basic Syntax

rclone moveto SOURCE DESTINATION [flags]
# Move and rename a file
rclone moveto /tmp/export.csv remote:archive/export-final.csv

# Move a local file to remote with a new name
rclone moveto /var/backups/dump.sql remote:db/dump-2024-01-15.sql

# Move between remotes
rclone moveto remoteA:staging/report.pdf remoteB:archive/report-q4.pdf

moveto vs move

Scenariomovemoveto
Move a directoryMoves contents preserving structureMoves to a specific path
Move a single filePlaces file inside destination directoryRenames file to destination path
Best forBulk directory movesSingle-file precision

Example Difference

# move — puts report.pdf INSIDE the archive/ directory
rclone move /tmp/report.pdf remote:archive/
# Result: remote:archive/report.pdf (source deleted)

# moveto — renames the file at the destination
rclone moveto /tmp/report.pdf remote:archive/q4-report.pdf
# Result: remote:archive/q4-report.pdf (source deleted)

Practical Examples

Move Processed Export with Timestamp

DATE=$(date +%Y-%m-%d-%H%M)
rclone moveto /srv/exports/data.csv \
remote:archive/exports/data-${DATE}.csv --progress

Move Database Dump to Cold Storage

rclone moveto /var/backups/db/full-dump.sql.gz \
cold-storage:db-archive/full-dump-$(date +%Y%m%d).sql.gz --progress

Move and Rename a Config Backup

rclone moveto /tmp/nginx-backup.tar.gz \
remote:configs/nginx-$(hostname)-$(date +%Y%m%d).tar.gz

Key Flags

FlagDescription
--dry-run / -nPreview without executing
--progress / -PShow transfer progress
--no-traverseSkip directory listing (faster for single files)
--log-file PATHWrite log to file

Common Pitfalls

PitfallConsequencePrevention
Typo in destination pathFile moved to wrong location, source deletedUse --dry-run first
Network failure during transferFile may exist at both source and destRe-run — rclone resumes safely
Using moveto for directoriesMay produce unexpected structureVerify behavior with --dry-run
No backup of sourceSource permanently deleted after moveEnsure destination is verified before critical moves

What's Next

Examples with Output

1. Move and rename a local file

Transfer a file to the cloud and give it a final name, then remove the local original. Command:

rclone moveto /tmp/temp_data.csv remote:archive/final_data_2024.csv

Output:

(No output on success)

2. Move a single file and overwrite remote

Replace a remote file with a local one and delete the local source. Command:

rclone moveto ./updates.json remote:app/current.json -v

Output:

2024/01/15 12:00:00 INFO  : current.json: Copied (replaced existing)
2024/01/15 12:00:00 INFO : updates.json: Deleted

3. Move a directory safely

Move all files in a folder to a new path. Command:

rclone moveto ./local_dir remote:target_dir

Output:

(All files in local_dir moved to target_dir, local_dir remains if not empty)

4. Dry run for safety

Verify which file would be targeted for the move. Command:

rclone moveto /src/file.txt remote:dest/new_file.txt --dry-run

Output:

2024/01/15 12:00:00 NOTICE: new_file.txt: Not moved as --dry-run is set

5. Check source after move

Confirm the local file is gone after a successful moveto. Command:

rclone moveto my_data.xls remote:data/my_data.xls && ls my_data.xls

Output:

ls: cannot access 'my_data.xls': No such file or directory