Automating Cloud Backups with Rclone and Cron

10 Rclone Commands Every Sysadmin Should Know

Rclone is a powerful command-line tool for syncing, copying, encrypting, and mounting cloud storage. Below are 10 essential rclone commands every sysadmin should know, with concise explanations and practical examples.

1. rclone config

Purpose: Create and manage remote configurations (cloud providers, credentials). Example:

rclone config

Notes: Use this to add a new remote, edit or test credentials, and set aliases. Prefer service account or key-based auth for automation.

2. rclone ls and rclone lsd

Purpose: List files and directories on a remote without downloading. Examples:

rclone ls remote:bucket/pathrclone lsd remote:bucket

Notes: ls shows files with sizes; lsd lists directories only. Useful for quick inventory.

3. rclone copy

Purpose: Copy files from source to destination (non-destructive; leaves source intact). Example:

rclone copy /local/dir remote:bucket/backup –progress

Notes: Add –dry-run to preview and –transfers/–checkers to tune performance.

4. rclone sync

Purpose: Make destination match source (deletes extraneous files on destination). Example:

rclone sync /local/dir remote:bucket/backup –progress

Notes: Use carefully—this will remove files on the destination that are not in source. –delete-excluded and –max-age help refine behavior. Always test with –dry-run first.

5. rclone move

Purpose: Move files from source to destination (removes source files after transfer). Example:

rclone move remote:incoming remote:archive –min-age 24h

Notes: Good for processing queues; combine with –min-age to avoid moving in-progress uploads.

6. rclone check

Purpose: Compare source and destination to verify integrity without transferring data. Example:

rclone check /local/dir remote:bucket/backup –one-way

Notes: Reports missing and mismatched files. Use –download to compare checksums if supported by the backend.

7. rclone mount

Purpose: Mount a remote as a filesystem (FUSE) for interactive use. Example:

rclone mount remote:bucket /mnt/remote –vfs-cache-mode writes &

Notes: Include –vfs-cache-mode for better app compatibility. Suitable for on-demand access but not always optimal for high-I/O production workloads.

8. rclone serve (http|webdav|sftp)

Purpose: Serve a remote over a protocol for ad-hoc access. Examples:

rclone serve http remote:bucket –addr :8080rclone serve webdav remote:bucket –addr :8081

Notes: Useful for temporary shares or integrating with apps that need a standard protocol. Consider security (TLS, auth) when exposing services.

9. rclone mount with caching and rclone vfs options (performance tuning)

Purpose: Optimize mounts for throughput and consistency. Example with key options:

rclone mount remote:bucket /mnt/remote –vfs-cache-mode full –vfs-cache-max-size 10G –buffer-size 1G

Notes: –vfs-cache-mode full improves compatibility; tune –buffer-size and –transfers for large-file workloads. Monitor memory/disk usage.

10. rclone sync/copy with filters and exclusions

Purpose: Exclude or include files using patterns to control transfers. Examples:

rclone sync /data remote:backup –exclude “.tmp” –exclude “/cache/“rclone copy /data remote:backup –include “.log” –min-size 1M

Notes: Use –filter-from for complex rules. Filters prevent accidental transfer of unwanted files and reduce bandwidth.

Practical Tips and Safety

  • Always use `

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *