How do you get the osx cli to run?

hi,

i’m sure i’m missing something simple. i tried running the binary from cli but i get a command not found error. if i run it as “bash duplicacy” i get a cannot execute binary file error. then i tried renaming the binary to .app/.pkg but that didn’t work either. so what am i missing?

thanks!

ranjit

The CLI binary is usually at /Applications/Duplicacy.app/Contents/Resources/duplicacy_osx_x64_2.0.6. If you install Duplicacy to a different directory then just change the /Applications to the install directory.

You can also download it from https://github.com/gilbertchen/duplicacy/releases.

I know this is a super old thread but I have searched all over for the answer to this and haven’t found it. I resorted to taking the cli out of the gui version but I would like to be able to download the cli releases and just run those (not to mention there are other releases on github like the duplicacy-util that I have the same issues with).

I just don’t know how to fix this and am sort of at a loss. It seems like something that everyone just knows but hasn’t been explicitly laid out anywhere.

Again, I apologize for resurrecting this thread but, given this is the only mention I have found of this issue for future people searching for the answer, it might be nice to have it linked here.

So, there actually are two separate questions here:

  1. Where to take executables from

  2. How to make them accessible from the terminal.

Answer on the first question is here: Releases · gilbertchen/duplicacy · GitHub
It is linked to in the side bar on the main page of this forum. Alternatively, you can build one from sources, link to the how-to is also in the sidebar: Build Duplicacy from source

The easiest way to get golang build environment on a Mac, if you want to go that route, is via MacPorts since most likely you already have them: you literally type sudo port -N install go and it will bootstrap golang 1.x and then build current golang with that. Then you just execute go get -u github.com/gilbertchen/duplicacy/... and you will end up with duoplicacy binary under ~/go/bin/duplicacy

Next, answer on the second question: the accepted practice is to place executable into /usr/sbin. That folder is designated location for “System daemons and system utilities executed by users”, which duplicacy is.

You an either rename the downloaded executable into “duplicacy” and place is there or you can save it into another folder and just create a symlink to it under /usr/sbin/ like so: sudo ln -s ~/Tools/duplicacy_osx_x64_2.0.10 /usr/sbin/duplicacy, or if you built it yourself - sudo ln -s ~/go/bin/duplicacy /usr/sbin/duplicacy

Then you can just call duplicacy directly since default `$PATH$ contains that folder.

Furthermore, if you want to setup unattended backup by schedule using native macOS scheduler - this post might help: Mac/OS X launchd example

I’m not sure I understand your question so if I missed the point please feel free to ask further questions, I’ll elaborate.

2 Likes

So I understand the part of puting it in /usr/sbin (though I put it in usr/bin, unsure if that is bad practice.)

The part I don’t understand is what the difference is between the version of “duplicacy_osx_x64_2.1.2”
available here: Releases · gilbertchen/duplicacy · GitHub and the version you get if you download the gui version from here: https://duplicacy.com/, go inside the package and copy over “duplicacy_osx_x64_2.1.2”.

Why does macos view the cli version I take out of the gui app, as an app, but not the file of the same name I find on github?

There is no difference, it’s exact same binary. Can you clarify why do you mean “as an app”?

Looking at Duplicacy.app:

mymbp:Duplicacy.app alex$ find .
.
./Contents
./Contents/_CodeSignature
./Contents/_CodeSignature/CodeResources
./Contents/Info.plist
./Contents/MacOS
./Contents/MacOS/Duplicacy
./Contents/PkgInfo
./Contents/Resources
./Contents/Resources/AppIcon.icns
./Contents/Resources/duplicacy-1024.png
./Contents/Resources/duplicacy-128.png
./Contents/Resources/duplicacy-16.png
./Contents/Resources/duplicacy-256.png
./Contents/Resources/duplicacy-32.png
./Contents/Resources/duplicacy-512.png
./Contents/Resources/duplicacy-64.png
./Contents/Resources/duplicacy_icon.png
./Contents/Resources/duplicacy_osx_x64_2.1.2
./Contents/Resources/Info-MAS.plist

This guy ./Contents/Resources/duplicacy_osx_x64_2.1.2 – is a command line duplicacy, exactly what you would download from the releases web page:

mymbp:Duplicacy.app alex$  ./Contents/Resources/duplicacy_osx_x64_2.1.2
NAME:
   duplicacy - A new generation cloud backup tool based on lock-free deduplication

USAGE:
   duplicacy [global options] command [command options] [arguments...]

VERSION:
   2.1.2 (2e5cbc)
^C

Is the behavior different for you?

1 Like

Yeah, that’s the part I am getting really confused about. On my computer they aren’t. When I try and copy over the version from github into usr/bin, replacing the file I had there before, extracted from the gui version, I get a “duplicacy: command not found” when I try to run it at command line. In finder, the icon for the extracted version looks like an executable, the file I download from github has a blank “unknown file type” icon.

So far as I can tell everyone is downloading the cli version from github just fine but for whatever reason my machine doesn’t recognize it as an app. Even though I can use the, supposedly, same app if I dig it out of the gui version.

1 Like

Maybe you have to mark the file as “executable” after you download it from github? This is what must be done on any linux system before using duplicacy (or any other downloaded executable), so maybe that’s what you have to do on your mac as well.

5 Likes

That’s it! Thank god. After a quick google search chmod a+x makes it run. I knew there must be something that people assumed everyone would know. In the docs it just basically just says download the cli version as you know.

Thanks both of you for your help. I had spent a long time searching google aimlessly trying to figure out what magic command everyone knew that I was missing. ha.

3 Likes

For anyone: Feel free to use the :heart: button on the posts that you found useful.

For the OP of any support topic: you can mark the post that solved your issue by ticking the image box under the post. That of course may include your own post :slight_smile:

I need some help! I just don’t know what to do. When I downloaded it I got duplicacy_osx_arm64_3.1.0 with no ending. What then? What exactly do I need to do? I googled chmod a+x, it says it changes the permissions for all users? So what is step one? Start the terminal, okay I did that and then? I’m doing my best, but I need detailed instructions. Every step. Please I’m not a stupid person I’m an engineer and just want to store my files. So coding is not my strength.
I bought the web GUI, but I can’t change the storage password there. So I have to use CLI. And another question, does the CLI connect to the Web GUI? So can I change my password or do I have to set everything up again in the CLI? Why is there no password change option in the web GUI? I mean guys like me who buy the web GUI, just want to have these basic functions without using terminal in the end.
Thanks Paul

So I’m not sure if I did it right, I opened the Duplicacy application package and showed it in the Finder. I found /Applications/Duplicacy Web Edition.app/Contents/MacOS/duplicacy_web_osx_arm64
I ran this application in Terminal. OK, the web GUI opened and Terminal showed me this:

Last login: Thu Apr 27 15:34:30 on ttys002
myusername@edr17637 ~ % /Applications/Duplicacy\ Web\ Edition.app/Contents/MacOS/duplicacy_web_osx_arm64 ; exit;
Log directory set to /Users/myusername/.duplicacy-web/logs
Duplicacy Web Edition 1.6.3 (31BDE1)
Starting the web server at http://127.0.0.1:3875

Is this the command line version?
I typed

$ duplicacy password

and pressed enter.
Nothing happened?
I’m lost, guys.

What? After trying this I realize now that it somehow changed changed my machines name in Duplicacy. Why? Under Backup it said I have a trial version. To make my copy valid again, I had to reenter my machine in the duplicacy licnense website tab. How can this happen?