Struggling with CLI to OneDrive

HI Guys
I have tried following a great guide here i am struggling to connect to OneDrive with CLI.
I have all the correct tokens for OneDrive but never get asked so i guess connection is not being made
My folder is on Unraid in a Share path as follows
I try to backup with
duplicacy add -copy default OneDrive local_dell one://Backup/Duplicacy/DellLaptop
bash: duplicacy: command not found

What am i doing wrong ?

Duplicacy seems to not be in the path. Try to call it with absolute path.

I tried of my main Pc got the following see here

The answer is on your screenshot, I’ve added arrows. Did you read your screenshot?

PS D:\vault> duplicacy add -copy OneDrive local_dell one://Backup/Duplicacy/DalePC1
--->>> The add command requires 3 arguments. <<<-----
     duplicacy add - Add an additional storage to be used for the existing repository 
     duplicacy add [command options] <storage name> <snapshot id> <storage url>


   -copy <storage name> 				make the new storage compatible with an existing one to allow for copy 

“storage name” is missing.

Sorry what seems obvious to a seasoned user is not to a noob.

  • duplicacy add - Add an additional storage to be used for the existing repository it’s a 2TB disk and its 37gb in size? It is in its own folder 1 image see here

OneDrive local_dell one://Backup/Duplicacy/DalePC1

So have i not done as requested?
I followed the guide sent to me and seem to be getting it all wrong?
I have a the json file in the folder?
I am trying to copy from PC to Unraid Server Backup & OneDrive

Also how does one install the script on the windows client for it towork with CLI?

This is correct, yes, however you have also passed the flag -copy, to make that storage copy compatible with another storage, but did not specify which storage it must be compatible with:

duplicacy add -copy <missing what storage to copy settings from> OneDrive local_dell one://Backup/Duplicacy/DalePC1

Does it make sense?

This is documentation for task scheduler on windows: About the Task Scheduler - Win32 apps | Microsoft Docs. In the nutshell – launch it, create new task, and then follow the prompts.

The Web UI front end will do all these manual tasks behind the scene, so you don’t have to; this is tremendous value. There is really no point in spending too much time trying to figure this all out just for the sake of configuring one tool. Time is money, and if you don’t deal with command line and windows internals in your day to day life – it would be poor use of your time to learn it just for this task, buying a license will be better use of resources, nothing wrong with that, nobody is an expert in everything.

I like full control over my backup so do it manually, but not everyone is (nor should be! like me).

I am trying to up skill myself in using CLI and have moved over to Unraid server and I have Home Assistant these skills will pay dividends. Time is not an issue and when the penny drops with me I catch on quickly.
The guides are good but a lot of presumption is mixed in with them thinking everybody must be at a high level.
But thank you for your help

I see. What I would then suggest, is download the CLI version to your local drive, on whatever OS you use, and play with it. Create a test folder, fill it with dummy files, initialize duplciacy repository there, check what files does it create, backup test folder to some other folder, restore, prune, etc., make mistakes, and read documentation – well designed command line tool (including duplicacy) provide sufficient diagnostic to figure out the issues.

Stuff that gets glossed over in most of tutorials is stuff that is easily discoverable. It’s an extremely important skill to have – diagnosing an issue and discovering direction to the solution. It’s way more important than learning any specific workflow in a specific skill with a specific OS. And discoverability starts with a habit to read error messages. Error messages get you to a solution 99% of times.

Example at hand --at that your screenshot duplciacy told you what’s missing, and not only that, printed documentation for the command, so you don’t have to go fish for it online.

Then, you made next step – saw a conflict in what you think you have provided (which was correct to add storage) to what duplicacy received (that included incomplete --copy argument).

Next step would be to step back and try to construct the command line again, using the manual just dumped, to add the storage, and then add --copy flag, at which point you would catch that you forgot to add the argument to --copy the first time, perhaps because you got distracted.

That’s the most important skills to acquire, and in fact, that’s precisely what I did when looking at your log – I don’t remember duplicacy command (or anything else for that matter) off hand, but having developed a habit to methodically step back and evaluate what software is telling you.

At some point yes, you woudl need external help, if you face some non-trivial situation, but that won’t happen until after you are so comfortable with the tool that you start venturing into unsupported configurations and breaking things (in a positive sense). At this point however forums would likely be useless, and you will end up figuring it out on your own, (and then hopefully writing your own blog post to help others, and/or sending pull requests with a fix)

That’s the idea.

And a side note - on windows making sense of command line interface is for some reason way harder than it is on macOS and Linux than it should be (and I’m former 15+ windows user who migrated 12+ years ago to macOS, so maybe I’m biased. Maybe not :wink: ), partly because of CMD/ PowerShell diffences (you have powershell on your screenshot which is way more than just a command line), and now Windows has whole linux runtime environment – you can use that, there is way more resources available to help navigate linux command line thats it is for windows. That last paragraphs is purely my subjective opinion.

Regardless, do reach out if you are stuck along the way – that’s why the forums exist, and nobody is born with all skills and knowledge. That wasn’t to discourage, but rather optimize efforts.

1 Like

Very good reply and this is what i am doing now. I had actually done some of that before i came on as proof of concept on a basic level. But i need to lift the skill level so it is second nature doing tasks that benefit using CLI. I have moved stuff around on same PC and to other Network folders.
The 2 areas that i need help in is the following

  1. In Unraid i have the docker container as mentioned to try Web version but no longer need it and i have removed any entries. How do i access the Duplicacy CLI in Unraid now? DO i still need the Docker Container? I have tried to access it via the CLI in the Docker but it seems empty no commands popup!

I have found if i go into the container console and type cd /config/bin then ./duplicacy_linux_x64_2.7.2 i get access to CLI. This seems a few hoops to go through in Unraid to get access quickly. Like in Windows adding it to Environment i can call it from any place. Is this possible in Unraid if so how?

  1. I cannot connect to OneDrive i am putting the json file in a the folders i am using but the CLI hangs?
    I cannot work out how to make a connection via CLI even following the documentation and i am not getting an error on a hang screen i have to shut it down to get access to the terminal again.

For the rest i will send next few weeks up skilling myself and reading further and thank you for your great reply

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