Jump to content

Rclone tutorial

From Pulsed Media Wiki


Rclone is a command-line tool for syncing files between your local computer and remote storage. It supports SFTP, so it works directly with your Pulsed Media seedbox (sometimes misspelled as sedbox) — no special configuration on the server side.

Rclone can do three things that basic SFTP clients cannot:

  • Sync directories (like rsync, but with a simpler interface)
  • Mount remote storage as a local drive (browse seedbox files in your file manager)
  • Automate transfers on a schedule

Installation

Linux (Debian/Ubuntu)

<syntaxhighlight lang="bash"> sudo apt install rclone </syntaxhighlight>

macOS

<syntaxhighlight lang="bash"> brew install rclone </syntaxhighlight>

Windows

Download from rclone.org/downloads. Extract the zip and add the folder to your PATH, or use the installer.

Setting up your seedbox remote

Run the interactive configuration:

<syntaxhighlight lang="bash"> rclone config </syntaxhighlight>

When prompted:

  1. Choose n (new remote)
  2. Name: seedbox
  3. Type: sftp
  4. Host: servername.pulsedmedia.com
  5. User: your seedbox username
  6. Port: 22
  7. Password: enter your seedbox password when prompted
  8. Accept defaults for the remaining options
  9. Save and quit

Test the connection:

<syntaxhighlight lang="bash"> rclone lsd seedbox:/home/username/ </syntaxhighlight>

You should see your seedbox directories (data, session, www).

Copying files

Copy downloads from seedbox to your local machine:

<syntaxhighlight lang="bash">

  1. Copy entire data directory

rclone copy seedbox:/home/username/data/ ~/seedbox/data/ --progress

  1. Copy a specific folder

rclone copy seedbox:/home/username/data/some-torrent/ ~/Downloads/some-torrent/ --progress </syntaxhighlight>

rclone copy skips files that already exist at the destination (same size and modification time). It does not delete anything.

Syncing directories

rclone sync makes the destination match the source exactly. Files deleted from the source are deleted from the destination.

<syntaxhighlight lang="bash">

  1. Sync seedbox data to local (WARNING: deletes local files not on seedbox)

rclone sync seedbox:/home/username/data/ ~/seedbox/data/ --progress

  1. Dry run first (shows what would happen without doing it)

rclone sync seedbox:/home/username/data/ ~/seedbox/data/ --dry-run </syntaxhighlight>

Use --dry-run first to verify before running a real sync. If you do not want local files deleted, use rclone copy instead.

Mounting as a local drive

Rclone can mount your seedbox as a folder on your local machine. Files appear in your file manager and can be opened directly — useful for playing media with VLC or Jellyfin without downloading entire files first.

Linux

<syntaxhighlight lang="bash">

  1. Install FUSE if not already present

sudo apt install fuse

  1. Create mount point

mkdir -p ~/mnt/seedbox

  1. Mount (runs in foreground — add & to background it)

rclone mount seedbox:/home/username/data/ ~/mnt/seedbox/ --vfs-cache-mode full

  1. Unmount

fusermount -uz ~/mnt/seedbox </syntaxhighlight>

macOS

Requires macFUSE:

<syntaxhighlight lang="bash"> brew install macfuse mkdir -p ~/mnt/seedbox rclone mount seedbox:/home/username/data/ ~/mnt/seedbox/ --vfs-cache-mode full </syntaxhighlight>

Windows

Requires WinFsp. After installing WinFsp:

<syntaxhighlight lang="bash"> rclone mount seedbox:/home/username/data/ X: --vfs-cache-mode full </syntaxhighlight>

This mounts the seedbox as drive X: in File Explorer.

Cache modes

The --vfs-cache-mode flag controls how rclone caches files locally:

Mode Behavior Use case
off No caching. Files are read directly from the remote. Listing files, quick checks
minimal Cache only what is needed for reads Browsing, small files
writes Cache reads and writes When writing files to mount
full Cache everything Media playback, heavy use (recommended)

With full caching, rclone downloads files to a local cache directory as they are accessed. Subsequent access to the same file is served from cache.

Filtering files

Include or exclude files by pattern:

<syntaxhighlight lang="bash">

  1. Copy only video files

rclone copy seedbox:/home/username/data/ ~/videos/ --include "*.mkv" --include "*.mp4" --progress

  1. Exclude temporary files

rclone sync seedbox:/home/username/data/ ~/seedbox/ --exclude "*.part" --exclude "*.tmp" </syntaxhighlight>

Performance tuning

<syntaxhighlight lang="bash">

  1. Transfer 8 files in parallel (default is 4)

rclone copy seedbox:/home/username/data/ ~/seedbox/ --transfers 8 --progress

  1. Limit bandwidth to 50 Mbps

rclone copy seedbox:/home/username/data/ ~/seedbox/ --bwlimit 50M --progress </syntaxhighlight>

The --transfers flag controls how many files are transferred simultaneously. Higher values use more bandwidth. If your connection can handle it, increasing from 4 to 8 or 16 can speed up transfers of many small files.

Automating transfers

To sync your seedbox data automatically on a schedule, create a small shell script:

<syntaxhighlight lang="bash">

  1. !/bin/bash
  2. seedbox-sync.sh — run via cron or systemd timer

rclone copy seedbox:/home/username/data/ ~/seedbox/data/ --log-file ~/rclone.log </syntaxhighlight>

Then add it to your crontab to run hourly (or at whatever interval you prefer). See your operating system's cron documentation for the syntax.

For automated transfers to work without a password prompt, set up the rclone remote with an SSH key or store the password in the rclone configuration (which rclone encrypts by default).

See also