How do you get the osx cli to run?


#1

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


#2

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.


#3

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.


#4

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.


#5

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?


#6

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?


#7

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.


#8

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.


#9

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.


Unable to install duplicacy.bin or duplicacy web gui Debian 9 (Stretch)
#10

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: