Overview
A local copy of a private OneDrive on a QNAP NAS at home. The NAS collects the data on its own every night with rclone, so no PC has to be running. Traffic goes one way only: from the cloud to the NAS.
A sync on its own is not a backup — if a file disappears in OneDrive, a plain mirror deletes it too. So nothing is thrown away here: whatever is deleted or overwritten in the cloud is moved into a dated version folder on the NAS.
current/ + versions/
Setup
Addresses and user names are placeholders. Folder names are shown in English here; on the
NAS they are German (aktuell, versionen).
Get rclone onto the NAS
The NAS cannot download it itself — its certificate store is too old for today’s HTTPS. So the ARM build is downloaded on the PC, copied to
/share/Public/rclone/withscpand made executable. Below,rcloneis short for that full path.Sign in to OneDrive on the Windows PC
The Microsoft login needs a browser, so
rclone configruns on Windows: remote nameonedrive, type OneDrive Personal. Quick check:.\rclone.exe lsd onedrive:Copy the finished config to the NAS
scp "$env:APPDATA\rclone\rclone.conf" <user>@<nas-ip>:/root/.config/rclone/rclone.confOn the NAS,
rclone lsd onedrive:now lists the top-level OneDrive folders.Create target folders and do a dry run
mkdir -p /share/CACHEDEV1_DATA/OneDrive-Backup/current /share/CACHEDEV1_DATA/OneDrive-Backup/versions rclone sync onedrive: /share/CACHEDEV1_DATA/OneDrive-Backup/current --dry-run --max-depth 2Start the first full sync in the background
setsidkeeps it alive after the SSH window closes; the flags keep it inside the 1 GB of RAM the NAS has.setsid rclone sync onedrive: /share/CACHEDEV1_DATA/OneDrive-Backup/current \ --backup-dir /share/CACHEDEV1_DATA/OneDrive-Backup/versions/$(date +%Y-%m-%d) \ --transfers 1 --checkers 1 --tpslimit 5 --buffer-size 0 --use-mmap --no-traverse \ --log-file /share/CACHEDEV1_DATA/OneDrive-Backup/rclone.log --log-level INFO \ < /dev/null > /dev/null 2>&1 &Schedule the nightly job
On QNAP the entry has to live in
/etc/config/crontab— anything added withcrontab -eis gone after the next reboot.crontab /etc/config/crontab /etc/init.d/crond.sh restartMake it visible in Windows
In QTS, create a shared folder
OneDrive-Backupand point it at the existing folder via “enter folder path manually”. It then shows up in Explorer under\\<nas-ip>\OneDrive-Backup.
Schedule
Every night via cron. Moving it to 04:30 is under consideration, so a long run can never overlap with the next one — two rclone processes at once are too much for 1 GB of RAM.
--transfers 1--checkers 1--tpslimit 5--buffer-size 0--use-mmap--no-traverseThe cron line — note that % has to be escaped as \% inside a crontab:
30 2 * * * rclone sync onedrive: /share/CACHEDEV1_DATA/OneDrive-Backup/current --backup-dir /share/CACHEDEV1_DATA/OneDrive-Backup/versions/$(date +\%Y-\%m-\%d) --transfers 1 --checkers 1 --tpslimit 5 --buffer-size 0 --use-mmap --no-traverse --log-file /share/CACHEDEV1_DATA/OneDrive-Backup/rclone.log --log-level INFO
Folders
versions/ stays empty after the first run and starts filling from the second one on.
Lessons learned
| Problem | Cause | Fix |
|---|---|---|
| QNAP’s own backup app (HBS 3) fails with “system error” | The Microsoft login never makes it back to the NAS — most likely the old firmware | Dropped HBS 3, switched to rclone |
| NAS cannot download rclone | Outdated certificate store rejects modern HTTPS sites | Download on the PC, copy with scp |
rclone config fails on the NAS | No browser for the login, long tokens can’t be pasted into the terminal | Configure on Windows, copy the finished rclone.conf |
| Sync dies shortly after starting | Default settings need more RAM than 1 GB; nohup doesn’t reliably keep it alive | setsid plus throttled flags — now runs steadily at about 76 MB |
| Cron job would vanish on reboot | QNAP rewrites the crontab at boot | Entry in /etc/config/crontab |
| Backup invisible on the network | A folder created over SSH is not a QTS share | Shared folder with a manually set path |
Status
Done
- rclone runs on the NAS and reads OneDrive
- First full sync (about 24 GB) started, roughly 6–8 hours
- Nightly job scheduled with throttled settings
- Backup visible in Windows Explorer
Open
- Check the log after the first nightly run
- Decide between 02:30 and 04:30
- Set the share to read-only for the everyday user
- Switch SSH off once nothing needs adjusting
- Look for a firmware update for the NAS
- As long as the job runs regularly, rclone renews the OneDrive token by itself. After a long pause or a
password change: run
rclone config reconnect onedrive:on the PC and copy the config to the NAS again.