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
| Scenario | move | moveto |
|---|---|---|
| Move a directory | Moves contents preserving structure | Moves to a specific path |
| Move a single file | Places file inside destination directory | Renames file to destination path |
| Best for | Bulk directory moves | Single-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
| Flag | Description |
|---|---|
--dry-run / -n | Preview without executing |
--progress / -P | Show transfer progress |
--no-traverse | Skip directory listing (faster for single files) |
--log-file PATH | Write log to file |
Common Pitfalls
| Pitfall | Consequence | Prevention |
|---|---|---|
| Typo in destination path | File moved to wrong location, source deleted | Use --dry-run first |
| Network failure during transfer | File may exist at both source and dest | Re-run — rclone resumes safely |
Using moveto for directories | May produce unexpected structure | Verify behavior with --dry-run |
| No backup of source | Source permanently deleted after move | Ensure 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