Help needed to set up rclone for OneDrive

What is the problem you are having with rclone?

I m trying to use Rclone to backup my files on Digitalocean server to OneDrive; I am stuck at this step while creating the config file,

If your browser doesn't open automatically go to the following link:
Log in and authorize rclone for access
Waiting for code...

I am running the commands from MobaXterm, tried to put the URL in my PC browser but gives me

" refused to connect."

This might look silly, but could someone guide me on this?

What is your rclone version (output from rclone version)


Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows 10, 64bit / VPS running Ubuntu 18.04

Which cloud storage system are you using? (eg Google Drive)


You need to pick the headless option on the config in the advanced section.

Basically, it's running something on the server and you can't connect remotely to that.

It should give you a URL to enter in instead of a web browser and you can paste the code back in.

Hi @Animosity022, thanks for your help. I do tried that option and ran command "rclone authorize 'onedrive'" and also tried with my app id and secret. then I received this message:

2020/02/14 14:31:19 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
If your browser doesn't open automatically go to the following link:
Log in and authorize rclone for access
Waiting for code...

You would need to run that on the machine that you have internet access on so the Windows PC.

Or you can port forward via ssh as well but that’s a bit more complex.

They key here is that is not a normal network address.
In networking, this address simply means "on this machine" - also known as "localhost".

Trying to reach this address from another PC would therefore not work.

The easiest way is to use the automatic setup (Y), but this requires that you have a web-browser you can access the internet with on the system. If not you need to use (N) and follow the instructions there, but it is not as straight-forward.

Hi @Animosity022 @thestigma, thanks. does that mean I need to install a browser on my vps?

It is not required to perform the second method (that is why it exists), but if you have the option of temporarily installing a browser on the server then that would certainly be a very easy fix to the problem as then you can just use the automatic method in rclone.

1 Like

You need to enter into the advanced config like I noted above:


Type N as you are working on a headless machine.


On a different machine like the one you are typing this message on that has a web browser and internet access, download rclone and run what it says:

On that machine once you type it in, it'll pop open your default browser and you get a code. Paste that code back into the original window and you are done.

This is my terminal for my Mac Laptop I'm typing on now:

@Animosity022 @thestigma thank you so much for your help. I installed Firefox on my vps and was able to complete the setup process. Next when I ran

rclone lsd remote:

I get this message:

2020/02/15 04:21:35 Failed to create file system for "remote:": didn't find section in config file

I tried to add my remote name after the colon, but that doesn't work.
is my config file not properly configured or something else is wrong? I really appreciate all the help.

Replace "remote:" with the name of your actual remote name you used in the config.

So my in example my remote is called GD:

So I can:

textere@seraphim Downloads % rclone lsf GD:
1 Like

Great that works! :grinning: And I was able to copy files from my server to OndDrive. Is there a way to automate this backup? I want to make a backup every day and only keep the recent 3 backups.

Of course... a very simple script can be made, adn then you simply schedule it to run (in task-scheduler or NSSM for Windows - or cron for Linux) every X hours, or once pr day/week - whatever.

If you need help on the specifics, let me know. I am the most familiar with batch (Windows), but know bash basics enough to do this there also - as this script would only have be really basic to do what you want.

@thestigma Thanks a lot. I do need help. I have set up Google Drive remote, now I want to back up my vps ttml folder on a daily basis to my Google Drive. so every day it is going to create a zip file (16202020_backup), and only keeps the recent 3 days backup. Are there any tutorials that I can follow? Thank you

For how to schedule a script to run in cron or taskmanager there are dozens of tutorials on Google.

For how to make this script specifically, that is probably a bit harder to do.
I don't mind just helping you do this though.

Here are some relevant facts that I must have to do anything:

  • Need to know the OS you want to run the script on (where you send the data from)
  • Need to know the exact folder-paths for the source and destination (the same paths that worked for you when you did it manually)
  • Do you want to move, copy, or sync this data? (ask if you ae not sure about the differences).

I might actually have a script that already does this - at least in batch.
The only feature that does not already have would be the limit on how backups to keep...
But maybe I can add that feature when I have a little time later on...

if you want to keep older versions of modified files, then use this flag

you are going to need to program, create some source code.
what language do you plan to write your scripts?
i have a python script, 350+ lines, that executes rclone, fastcopy and 7zip file with time and date in the filenames.

another option is to use rclone mount the remote as x: drive. and you normal windows software to create the backups and zip files.

for example, this script will create a zip file directly on your remote.

rclone.exe mount secret: x: --vfs-cache-mode=writes
C:\data\rclone\scripts\7za.exe a x:\zork\zork.20191208.135853.7z C:\data\M\games\zork\

Thank you so much. let me try myself first. Really appreciate your kind help.

Thanks for your help. Do you mind sharing your script with me? I can try to see if I can use it for my use case.

if you want to use VSS with rclone, check out my wiki

about my python program, there is no documentation.
the python code, dynamically creates a bunch of .cmd files and runs the .cmd files.

and you might want to read this post.

Thanks again. I will try to absorb them. :grinning:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.