Back up a Synology NAS to Drime with rclone
Copy and sync the folders of your Synology NAS to Drime with rclone's official Drime backend, run in Docker and scheduled with DSM's Task Scheduler.
This guide follows rclone's and Synology's official documentation: rclone Drime backend, rclone with Docker, Synology Task Scheduler and Synology SSH.
rclone has an official Drime backend, so a Synology NAS can copy its folders to Drime on a schedule: rclone runs in Docker on the NAS, and DSM's Task Scheduler starts it. The files arrive in Drime as ordinary files you can open, share and download.
No single official page covers this whole setup: this guide puts the two documentations together. Drime does not support rclone or DSM themselves: for help with them, see their documentation.
#What you need
A Synology NAS on DSM 7, with an administrator account.
Synology's Docker package: Container Manager on DSM 7.2 and later, Docker on DSM 7.1 and earlier.
SSH access, only if you prefer rclone's interactive setup.
A Drime account with enough free storage for what you back up.
A Drime API token, created in the next section.
#Create an API token
In the Drime web app, click your avatar, then Settings > Developers.
In API access tokens, click Create token.
Name the token after the NAS, for example "Synology NAS", and keep the All permission.
rclone must be able to upload, list and delete. A Read Only token only lets rclone download.

Click Create, copy the token, then click Done.
The token is shown only once: keep it for the next step, or store it in a password manager.

All the token options are in Create an API token.
#The commands in this guide
Every command runs rclone's official Docker image the way rclone's documentation shows it. Replace the placeholders in capitals:
Placeholder | Replace with | Example |
|---|---|---|
| A NAS folder for rclone's settings |
|
| The NAS folder to back up, or to restore into |
|
| The Drime folder that receives the backup |
|
| Your Drime API token |
Use full NAS paths, starting with /volume. Inside Docker, rclone sees CONFIG_FOLDER as /config/rclone and NAS_FOLDER as /data.
#Configure rclone on the NAS
#With Container Manager, without SSH
In DSM, open Control Panel > Task Scheduler.
Click Create, then Scheduled Task > User-defined script.
Name the task, for example "rclone setup", and choose the root user.
In Task Settings, paste the setup command under Run command.
docker run --rm \ --volume CONFIG_FOLDER:/config/rclone \ --user $(id -u):$(id -g) \ rclone/rclone \ config create drime drime access_token YOUR_API_TOKENIt downloads rclone's official image and creates a remote named
drime.Save the task, select it in the list, then click Run.
Delete the task afterwards: it contains your token.
#With SSH
If you prefer rclone's interactive setup:
In DSM, open Control Panel > Terminal & SNMP > Terminal, then tick Enable SSH service.
Synology warns that enabling SSH may bring security risks: turn it off again when you are done.
From your computer, connect to the NAS with SSH, then run
sudo -i.SSH sign-in needs an account in the local administrators group, and
sudo -iasks for that account's password.Start rclone's interactive setup.
docker run --rm -it \ --volume CONFIG_FOLDER:/config/rclone \ --user $(id -u):$(id -g) \ rclone/rclone \ configAnswer rclone's questions to create the
drimeremote.Type
nfor a new remote, the namedrime, the storage typedrime, then paste your API token ataccess_token.
To check the setup, the same command with listremotes instead of config should list drime:.
#Make a first copy
Start with rclone copy: it adds files to Drime and never deletes anything there. Create a task as above, with the root user, and this command:
docker run --rm \
--volume CONFIG_FOLDER:/config/rclone \
--volume NAS_FOLDER:/data:shared \
--user $(id -u):$(id -g) \
rclone/rclone \
copy /data drime:DRIME_FOLDERRun the task, then check the result in Drime.
#Keep Drime in step with sync
rclone sync makes the Drime folder match the NAS folder.
Run this once and read the task's output:
docker run --rm \
--volume CONFIG_FOLDER:/config/rclone \
--volume NAS_FOLDER:/data:shared \
--user $(id -u):$(id -g) \
rclone/rclone \
sync /data drime:DRIME_FOLDER --dry-runRemove --dry-run once the list is what you expect. Files rclone deletes in Drime go to your Drime Trash; rclone's advanced option hard_delete deletes them permanently instead.
#Schedule the backup
In Control Panel > Task Scheduler, create a Scheduled Task with the root user.
Choose User-defined script.
On the Schedule tab, choose the days and the time, for example every night.
In Task Settings, paste your
copyorsynccommand under Run command.You can also ask DSM to email you the run details, or only when the script ends abnormally.
#Check your files in Drime
Open the Drime web app: DRIME_FOLDER holds your files with their usual names. They count toward your Drime storage like any other file.
Good to know, from rclone's Drime documentation:
Changes are detected by size. Drime does not give rclone modification times or hashes, so a file edited without changing its size is not copied again.
File names can be up to 255 bytes long (in UTF-8).
Workspaces: rclone's advanced option
workspace_idsends the backup to a workspace instead of your own files.Times in rclone's output are in UTC: the rclone container uses UTC unless its
TZvariable is set.
#Restore files
Copy them back from Drime with rclone copy, the other way round. Use an empty NAS folder as NAS_FOLDER, for example /volume1/restore:
docker run --rm \
--volume CONFIG_FOLDER:/config/rclone \
--volume NAS_FOLDER:/data:shared \
--user $(id -u):$(id -g) \
rclone/rclone \
copy drime:DRIME_FOLDER /dataYou can also download single files from the Drime web app.
#If it doesn't work
What you see | What to do |
|---|---|
rclone says it did not find the | The command does not use the same |
rclone cannot find |
|
The task fails right away with a Docker error | Check that Container Manager (or Docker on DSM 7.1) is installed and that the task runs as root. |
rclone stopped connecting to Drime | The token may have been deleted or revoked: the Drime API answers |
rclone can list and download but not upload | The token may be Read Only. Create a token with All, then replace it the same way ( |
Uploads fail when your storage is almost full | Your Drime storage may be full. See Check and free up storage space. After a |
Two-factor authentication is on for your Drime account | Nothing to change: rclone uses the API token, not your password. |
A file with a very long name is not copied | Its name is over 255 bytes. Shorten it on the NAS. |
#Next steps
Was this helpful?