Connect Drive with rclone

Configure a WebDAV remote in rclone with the Drive URL and your device password, then sync from the command line.

Article details

Type, difficulty, plans, and last updated info.

Type
Guide
Difficulty
Beginner
Plans
Nano · Starter · Pro · Agency
Last updated
May 22, 2026

rclone is a command-line sync tool that works with WebDAV. Unlike Finder or Windows Explorer, rclone has no file-size limit, uploads in parallel, and supports two-way sync and scheduled backups. It's the best option for large transfers and unattended jobs.

Before you start

You need a device password. Sync apps get their own one-time password — that way you can revoke rclone without touching your dashboard login.

  1. Open Sync devices in your TrekMail dashboard.
  2. Click + Add new device.
  3. Name it (e.g. Laptop — rclone).
  4. Leave View files and Edit files checked.
  5. Click Generate password and copy the password (dsync_...).

For read-only backup to Drive, Edit files is required. For one-way restore from Drive (download only), View files alone is enough.

Install rclone

  • macOS: brew install rclone
  • Linux: curl https://rclone.org/install.sh | sudo bash
  • Windows: download from rclone.org/downloads and add to PATH.

Configure the remote

Run the interactive configurator:

rclone config

Then:

  1. n — new remote.
  2. Name it trekmail-drive (or anything you like).
  3. Pick WebDAV from the list (number changes between versions; look for the word "Webdav").
  4. URL: paste the Drive server URL from the Sync devices page — it looks like https://drive.YOUR-DOMAIN/dav/files/account/. Keep the trailing slash.
  5. Vendor: pick other.
  6. User: your TrekMail account email.
  7. Password: pick y (yes, type my own password), then paste the dsync_... device password.
  8. Bearer token: leave blank.
  9. Edit advanced config: n.
  10. Confirm: y.

You can also write the config file directly. Open ~/.config/rclone/rclone.conf and add:

[trekmail-drive]
type = webdav
url = https://drive.YOUR-DOMAIN/dav/files/account/
vendor = other
user = you@example.com
pass = <obscured-password>

Generate the obscured password with rclone obscure dsync_....

Day-to-day commands

List files

rclone ls trekmail-drive:
rclone lsd trekmail-drive:        # directories only

Upload a file

rclone copy ./backup.zip trekmail-drive:Backups/

Upload a folder (one-way, with progress)

rclone copy ./Documents trekmail-drive:Documents \
  --progress --transfers 8

--transfers 8 uploads up to 8 files in parallel. Bump it higher on fast networks.

Sync a folder (mirror — deletes on Drive what's missing locally)

rclone sync ./Documents trekmail-drive:Documents --progress

Caution: sync deletes files on Drive that don't exist locally. Use copy if you're not sure.

Mount as a folder

mkdir ~/trekmail
rclone mount trekmail-drive: ~/trekmail \
  --vfs-cache-mode writes --daemon

This makes Drive show up as ~/trekmail. Tools that don't speak WebDAV (Photos, Lightroom, etc.) can use it like any local folder.

Unmount

fusermount -u ~/trekmail           # Linux
umount ~/trekmail                  # macOS

Scheduled backups

On Linux/macOS, add to your crontab (crontab -e):

# Back up ~/Documents nightly at 2 AM
0 2 * * * /usr/local/bin/rclone copy ~/Documents trekmail-drive:Documents --quiet

On Windows, use Task Scheduler to run the same rclone copy command.

Tuning for big transfers

For large files (multi-GB videos, datasets):

rclone copy ./big.iso trekmail-drive:ISOs/ \
  --transfers 4 \
  --multi-thread-streams 4 \
  --buffer-size 64M \
  --progress

rclone splits large uploads into chunks and runs them in parallel. The server reassembles them.

Troubleshooting

  • 401 Unauthorized — password is wrong or revoked. Generate a new one in Sync devices.
  • 403 insufficient_scope — the device password is read-only but you're trying to upload. Create a new password with Edit files checked.
  • 429 Too Many Requests — back off --transfers to 4 and try again. Drive rate-limits per device password.
  • 507 Insufficient Storage — your Drive pool is full. Resize your add-on or empty the trash.
  • Mounted folder shows stale files — clear rclone's cache with rclone mount options --vfs-cache-mode writes --dir-cache-time 1m.

For broader sync issues, see Drive Sync troubleshooting.

Related articles

Jump to nearby guides that continue the workflow.

We use cookies for essential functionality. No ads, no ad tracking.

Sign in to TrekMail

Access your dashboard, mailboxes and DNS.

or
or

Reset email sent

If an account exists for this email, we've sent password reset instructions.

By continuing, you agree to TrekMail's Terms and Privacy Policy.