Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install to running duplicacy #442

Closed
ccdanieldb opened this issue Jun 7, 2018 · 19 comments
Closed

Install to running duplicacy #442

ccdanieldb opened this issue Jun 7, 2018 · 19 comments

Comments

@ccdanieldb
Copy link

ccdanieldb commented Jun 7, 2018

I am not sure if this is the right place but please help, I can't figure this out. How do I get from

pkg install wget
pkg install go
go get -u github.com/gilbertchen/duplicacy/...
go build -v /root/go/src/github.com/gilbertchen/duplicacy/duplicacy/duplicacy_main.go
chmod +x /root/go/bin/duplicacy

To running duplicacy.

I am running this on a FreenNAS ver-11.1-U5 jail.

----edit----

Ok got it running by downloading the prebuilt exe. Here are the steps.

pkg install wget Needed to download a file on my system. You may have it installed already.
pkg install go. Not sure if I needed it but I got it anyway.
mkdir /root/go/
mkdir /root/go/bin/
cd /root/go/bin/
wget https://github.com/gilbertchen/duplicacy/releases/download/v2.1.0/duplicacy_freebsd_x64_2.1.0
mv duplicacy_freebsd_x64_2.1.0 duplicacy Changes name to duplicacy. The .0 at the end of the original file was preventing it from running not sure why.
chmod +x duplicacy Makes the file executable.
./duplicacy Runs the file in this directory.
/root/go/bin/duplicacy Runs the file in any other directory.

@TheBestPessimist
Copy link
Contributor

TheBestPessimist commented Jun 7, 2018

If you try to run /root/go/bin/duplicacy now, what happens?

Also note: the duplicacy version on github is the non-gui one!

@ccdanieldb
Copy link
Author

ccdanieldb commented Jun 7, 2018

LOL. I am not sure why this is happing but please see for your self. I must have been misspelling it before. I am sure I also tried ./duplicacy and also sure it did not work several hours ago.
/root/go/bin/duplicacy
is working now.

root@duplicacy:/ # cd /root/go/bin/
root@duplicacy:/go/bin # ls
duplicacy duplicacy_main
root@duplicacy:
/go/bin # duplicacy
duplicacy: Command not found.
root@duplicacy:/go/bin # /duplicacy
/duplicacy: Permission denied.
root@duplicacy:
/go/bin # /root/go/bin/duplicacy
NAME:
duplicacy - A new generation cloud backup tool based on lock-free deduplication

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

VERSION:
2.1.0

COMMANDS:
init Initialize the storage if necessary and the current directory as the repository
backup Save a snapshot of the repository to the storage
restore Restore the repository to a previously saved snapshot
list List snapshots
check Check the integrity of snapshots
cat Print to stdout the specified file, or the snapshot content if no file is specified
diff Compare two snapshots or two revisions of a file
history Show the history of a file
prune Prune snapshots by revision, tag, or retention policy
password Change the storage password
add Add an additional storage to be used for the existing repository
set Change the options for the default or specified storage
copy Copy snapshots between compatible storages
info Show the information about the specified storage
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
-verbose, -v show more detailed information
-debug, -d show even more detailed information, useful for debugging
-log enable log-style output
-stack print the stack trace when an error occurs
-no-script do not run script before or after command execution
-background read passwords, tokens, or keys only from keychain/keyring or env
-profile address:port enable the profiling tool and listen on the specified address:port
-comment add a comment to identify the process
-help, -h show help

root@duplicacy:~/go/bin #

@gboudreau
Copy link
Contributor

To run an executable from the current directory, you need to use ./duplicacy
duplicacy by itself will look in all the folders listed in $PATH to find the executable in question
/duplicacy will try to run an duplicacy executable from the / (root) directory.

@TheBestPessimist
Copy link
Contributor

aaah, the old windows vs linux name lookup problem. this bugs me as well when i use a linux machine.

@ccdanieldb
Copy link
Author

I am still having some trouble. It looks like duplicacy can't see the directory I am executing it in. Please see below. Again this is in a freenas jail. I have given the jail read/wright permissions to files I am trying to backup.

root@duplicacy:/mnt/Stuff # duplicacy init -e Stuff sftp://Daniel@10.0.1.64:/mnt/RaidZ3/Stuff duplicacy: Command not found. root@duplicacy:/mnt/Stuff # /duplicacy init -e Stuff sftp://Daniel@10.0.1.64:/mnt/RaidZ3/Stuff /duplicacy: Permission denied. root@duplicacy:/mnt/Stuff # ./duplicacy init -e Stuff sftp://Daniel@10.0.1.64:/mnt/RaidZ3/Stuff ./duplicacy: Not a directory. root@duplicacy:/mnt/Stuff # /root/go/bin/duplicacy init -e Stuff sftp://Daniel@10.0.1.64:/mnt/RaidZ3/Stuff Failed to retrieve the current working directory: stat .: not a directory root@duplicacy:/mnt/Stuff #

@TheBestPessimist
Copy link
Contributor

TheBestPessimist commented Jun 7, 2018

ok, so let's start with this:

  1. where is the duplicacy executable file located?
    • is it in /root/go/bin/? i will continue my example with this path, for now.
    • you should find this out
  2. assuming /root/go/bin/duplicacy is the correct duplicacy executable (full path to duplicacy), then
  3. you are trying to init a new repo in /mnt/Stuff
    • this should be the command:
      - cd /mnt/Stuff
      - /root/go/bin/duplicacy init -e Stuff sftp://Daniel@10.0.1.64:/mnt/RaidZ3/Stuff

You should see from my example that i am using the full path to duplicacy. This is needed because you are in the folder /mnt/Stuff (windows equivalent: c:/mnt/Stuff) which does not contains the duplicacy executable.
The duplicacy executable has the full path (repeat: in my example) /root/go/bin/duplicacy (windows equivalent: c:/root/go/bin/duplicacy.exe -- note that on windows you would have .exe but on linux you dont always need it).

Rule of thumb for your case: when you do any duplicacy commands, you should always use the full path for duplicacy: /root/go/bin/duplicacy.

@ccdanieldb
Copy link
Author

ccdanieldb commented Jun 7, 2018

  1. You are correct the exe is in /root/go/bin/
  2. Also correct I am trying to backup files/folders at /mnt/Stuff
  3. When I call the exe from /root/go/bin/duplicacy in the folder /mnt/Stuff using the below
    /root/go/bin/duplicacy init -e Stuff sftp://Daniel@10.0.1.64:/mnt/RaidZ3/Stuff

I get this error.
Failed to retrieve the current working directory: stat .: not a directory

I am not sure if the error is coming from a path on this computer (freenas1) or the remote computer (freenas2).

@ccdanieldb ccdanieldb reopened this Jun 7, 2018
@TheBestPessimist
Copy link
Contributor

i have the feeling it's from freenas1, but i am not sure.
what does ls -l give you?

Also, try to set as storage destination a folder where you have write access on this nas first. Something like: /root/go/bin/duplicacy init -e Stuff /tmp/duplicacyTestStorage/ and see what happens. (create folders as needed respectively)

@ccdanieldb
Copy link
Author

#($. The jail dropped the share.
ls -l returns
..: Not a directory.

@ccdanieldb
Copy link
Author

Thanks for all your help. It looks like it is working for now. Maybe I should move it out of the jail for stability.

@fracai
Copy link
Contributor

fracai commented Jun 7, 2018

Moving out of the jail should be fine. As a bonus, you wouldn't have to mount your storage in the jail and could reference the files in their natural structure.
There also shouldn't be any need to compile the binary yourself. The FreeBSD build works just fine for me in FreeNAS. Are you compiling to get unreleased features or a custom build?

@ccdanieldb
Copy link
Author

The FreeBSD build works just fine for me in FreeNAS. Are you compiling to get unreleased features or a custom build?

No. Just following the instructions from the QuickStart page. Also I have an other problem. I get the below sftp error after giving the password to the client.

root@duplicacy:/mnt/Stuff # /root/go/bin/duplicacy init -e Stuff sftp://Daniel@10.0.1.64//mnt/RaidZ3/Stuff/
Enter SSH password:*********************
Enter storage password for sftp://Daniel@10.0.1.64//mnt/RaidZ3/Stuff/:*********************
Re-enter storage password:*********************
Failed to configure the storage: sftp: "Permission denied" (SSH_FX_PERMISSION_DENIED)

@TheBestPessimist
Copy link
Contributor

this looks like an error on the other side. Check that you have the folders already created on the destination 10.0.1.64//mnt/RaidZ3/Stuff/.

also, you can run duplicacy with -d to show debug info -- maybe you'll get a hint from there what the problem is.

@ccdanieldb
Copy link
Author

ccdanieldb commented Jun 7, 2018

Looks like it failed to read the ssh key. I did not upload one. I am logging in with password for now. Any idea what it means.

root@duplicacy:/mnt/Stuff # /root/go/bin/duplicacy -d init -e Stuff sftp://Daniel@10.0.1.64//mnt/RaidZ3/Stuff
Reading the environment variable DUPLICACY_SSH_KEY_FILE
Attempting password login
Reading the environment variable DUPLICACY_SSH_PASSWORD
Failed to store the value to the keyring: keyring: No suitable keyring provider found (check your build flags)
Enter SSH password:*********************
Reading the environment variable DUPLICACY_SSH_PASSWORD
Failed to store the value to the keyring: keyring: No suitable keyring provider found (check your build flags)
Reading the environment variable DUPLICACY_PASSWORD
Failed to store the value to the keyring: keyring: No suitable keyring provider found (check your build flags)
Enter storage password for sftp://Daniel@10.0.1.64//mnt/RaidZ3/Stuff:*********************
Reading the environment variable DUPLICACY_PASSWORD
Failed to store the value to the keyring: keyring: No suitable keyring provider found (check your build flags)
Re-enter storage password:*********************
Failed to configure the storage: sftp: "Permission denied" (SSH_FX_PERMISSION_DENIED)
root@duplicacy:/mnt/Stuff #

@ccdanieldb
Copy link
Author

How did I install this if I start with?
wget https://github.com/gilbertchen/duplicacy/releases/download/v2.1.0/duplicacy_freebsd_x64_2.1.0

@TheBestPessimist
Copy link
Contributor

no need to install. just run it like any other executable file. G O M A G I C

@fracai
Copy link
Contributor

fracai commented Jun 7, 2018

You probably need to make it executable with:
chmod +x duplicacy_freebsd_x64_2.1.0

And it would probably be a good idea to rename it to something simpler:
mv duplicacy_freebsd_x64_2.1.0 duplicacy

@ccdanieldb
Copy link
Author

Dose it need to be in the /root/go/bin/ directory?

@ccdanieldb
Copy link
Author

Thanks guys for all your help. It seems to be running now. I have an other issue that I think I should open a new ticket for.

Semper Fi
Daniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants