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.
▼
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.
- Open Sync devices in your TrekMail dashboard.
- Click + Add new device.
- Name it (e.g.
Laptop — rclone). - Leave View files and Edit files checked.
- 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:
n— new remote.- Name it
trekmail-drive(or anything you like). - Pick WebDAV from the list (number changes between versions; look for the word "Webdav").
- 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. - Vendor: pick
other. - User: your TrekMail account email.
- Password: pick
y(yes, type my own password), then paste thedsync_...device password. - Bearer token: leave blank.
- Edit advanced config:
n. - 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--transfersto 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 mountoptions--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.