borg backup via ssh

  • A repository already exists at /Malcolm@100.121.165.10


    I think it's not reading the path properly, and there's a repo in the Malcom home folder (it does not matter because you want to use another path.

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • Execute this


    Code
    borg info 'Malcolm@100.121.165.103:/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA'


    What's the response?


    Also try


    Code
    borg info 'ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA'



    According to borg's docs:


    Remote repositories accessed via ssh user@host:

    user@host:/path/to/repo - remote repo, absolute path

    ssh://user@host:port/path/to/repo - same, alternative syntax, port can be given

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • What's the response?

    $ borg info 'Malcolm@100.121.165.103:/srv/mergerfs/Data/Malcolmbackup/Borgbackup /Backup-Bo-OMV_NOVA'

    Repository Malcolm@100.121.165.103:/srv/mergerfs/Data/Malcolmbackup/Borgbackup/B ackup-Bo-OMV_NOVA does not exist.

    $


    Also try



    Code borg info 'ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA'

    $ borg info 'ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA'

    Repository ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA does not exist.

    $

  • Also try



    Code borg info 'ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA'

    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server?


    OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server? in /usr/share/php/openmediavault/system/process.inc:217

    Stack trace:

    #0 /usr/share/openmediavault/engined/rpc/borgbackup.inc(184): OMV\System\Process->execute(Array, 2)

    #1 [internal function]: OMVRpcServiceBorgBackup->setRepo(Array, Array)

    #2 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)

    #3 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('setRepo', Array, Array)

    #4 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('BorgBackup', 'setRepo', Array, Array, 1)

    #5 {main}



    Code borg info 'Malcolm@100.121.165.103:/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA'


    What's the response?

    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'Malcolm@100.121.165.103:/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server?


    OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'Malcolm@100.121.165.103:/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server? in /usr/share/php/openmediavault/system/process.inc:217

    Stack trace:

    #0 /usr/share/openmediavault/engined/rpc/borgbackup.inc(184): OMV\System\Process->execute(Array, 2)

    #1 [internal function]: OMVRpcServiceBorgBackup->setRepo(Array, Array)

    #2 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)

    #3 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('setRepo', Array, Array)

    #4 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('BorgBackup', 'setRepo', Array, Array, 1)

    #5 {main}

  • Ok, this looks good. any of the two commands should work in the plugin too.

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • Ok, this looks good. any of the two commands should work in the plugin too.

    they do not


    Malcolm@100.121.165.103:/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA


    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'Malcolm@100.121.165.103:/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server?


    OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'Malcolm@100.121.165.103:/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server? in /usr/share/php/openmediavault/system/process.inc:217

    Stack trace:

    #0 /usr/share/openmediavault/engined/rpc/borgbackup.inc(184): OMV\System\Process->execute(Array, 2)

    #1 [internal function]: OMVRpcServiceBorgBackup->setRepo(Array, Array)

    #2 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)

    #3 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('setRepo', Array, Array)

    #4 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('BorgBackup', 'setRepo', Array, Array, 1)

    #5 {main}


    ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA


    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server?


    OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'ssh://Malcolm@100.121.165.103:22/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server? in /usr/share/php/openmediavault/system/process.inc:217

    Stack trace:

    #0 /usr/share/openmediavault/engined/rpc/borgbackup.inc(184): OMV\System\Process->execute(Array, 2)

    #1 [internal function]: OMVRpcServiceBorgBackup->setRepo(Array, Array)

    #2 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)

    #3 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('setRepo', Array, Array)

    #4 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('BorgBackup', 'setRepo', Array, Array, 1)

    #5 {main}

  • $ borg init --encryption=repokey Malcolm@100.121.165.103/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA

    The parent path of the repo directory [/srv/mergerfs/Pool1/Public-Test-2/malcolm/Malcolm@100.121.165.103/srv/mergerfs/Data/Malcolmbackup/Borgbackup/Backup-Bo-OMV_NOVA] does not exist.

    very odd?

  • you used the wrong path.


    borg init --encryption=repokey ssh://Malcolm@100.121.165.103/srv/mergerfs/Data/homedir/Malcolm/Borgbackup/Backup-Bo-OMV_NOVA


    in the plugin



    odd enough i get a denied error

    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'ssh://Malcolm@100.121.165.103/srv/mergerfs/Data/homedir/Malcolm/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server?


    OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='H3rrm@nns3n'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'ssh://Malcolm@100.121.165.103/srv/mergerfs/Data/homedir/Malcolm/Borgbackup/Backup-Bo-OMV_NOVA' 2>&1' with exit code '2': Remote: Permission denied, please try again.

    Remote: Permission denied, please try again.

    Remote: Malcolm@100.121.165.103: Permission denied (publickey,password).

    Connection closed by remote host. Is borg working on the server? in /usr/share/php/openmediavault/system/process.inc:217

    Stack trace:

    #0 /usr/share/openmediavault/engined/rpc/borgbackup.inc(184): OMV\System\Process->execute(Array, 2)

    #1 [internal function]: OMVRpcServiceBorgBackup->setRepo(Array, Array)

    #2 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)

    #3 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('setRepo', Array, Array)

    #4 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('BorgBackup', 'setRepo', Array, Array, 1)

    #5 {main}

  • Which command have you used to manually create the repo?

    Edit: I didn't see it, you wrote it. It looks correct.


    By the way it's only a test since the plugin must create it.


    At this point I don't understand why the plugin is not working.

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • I Need to replicate in a VM. Give me some time.


    It might be the plugin not reading the key file. It always errors out there.

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • to create repro: borg init --encryption=repokey ssh://Malcolm@100.121.165.103/srv/mergerfs/Data/homedir/Malcolm/Borgbackup/Backup-Bo-OMV_NOVA

    to create backup: borg create --list ssh://Malcolm@100.121.165.103/srv/mergerfs/Data/homedir/Malcolm/Borgbackup/Backup-Bo-OMV_NOVA::Backup-Bo-OMV_NOVA /srv/mergerfs/Pool1/ --exclude '/srv/mergerfs/Pool1/Emoncmsbackup'

  • I have been following this forum post as I too am having the same errors when trying to create the remote repo via the GUI.

    I have setup and tested ssh from client to server from command line all working ok. No password prompts etc all good.

    I too can create remote repo as per instructions and all works ok. from command line only NOT via GUI.

    I followed the guide as above in setting this up....


    The thing that puzzled me was this instruction

    export BORG_RSH='ssh -i /etc/ssh/my_secure_server_key'


    i did try export BORG_RSH='ssh -i ~/.ssh/id_rsa'


    this did not work either in the GUI

    getting same errors as before


    when I generated my key pairs it was placed in the users home folder in a sub folder .ssh with the default file names of

    id_rsa <being private key>

    id_rsa.pub <being public key>


    I checked the /etc/ssh folder and there was no id_rsa or id_rsa.pub.

    I did notice there were private and public keys from other systems placed there generated by OMV and plugins.

    example

    ssh_host_ecdsa_key

    ssh_host_ecdsa_key.pub

    etc..........


    I then copied my id_rsa and id_rsa.pub to /etc/ssh folder

    Renamed id_rsa to ssh_host_borg_key

    and id_rsa.pub ssh_host_borg_key.pub


    then chmod 600 on both these files so only the owner has access to these in my case borg user



    export BORG_RSH='ssh -i /etc/ssh/ssh_host_borg_key'


    re attempted to create again via GUI

    ssh://borg@mountaineagle-technologies.com.au:7290/borg_volume/golfclub10


    Getting same permission errors etc as before.


    I then looked at the GUI and found a TAB that said 'environment variables '

    nothing was listed

    I then created the BORG_RSH variables in the GUI as below



    note there is a drop down box on repo*

    Repo creation

    then will list any repo's you have created

    select Repo creation

    then save




    Next create the remote repo

    Select Repos the + to add


    Click Save


    Result




    Now we can proceed to create Archive from GUI


    But before we do we need to go back into environment variables TAB select BORG_RSH variable and change it from Repo creation to point to the repo you just created using the drop down box



    If you do not change you will get authentication errors when you attempt to create archive as below



    Point BORG_RSH to REPO as above eg golfclub_remote


    Then select archive and execute with the right arrow



    Success yes wallah !!!!!!!


    So I think the environment variable BORG_RSH being set at the command line level isn't working somehow


    as in instruction

    export BORG_RSH='ssh -i /etc/ssh/my_secure_server_key'


    I have being trying to nut this out for a long time. Reading guides and checking forums

    Love the GUI to borg backup Thankyou to the writer


    And now I can have a offsite repo's as well as local for security and redundancy


    I don't know if the process I took is the correct way, but it all clicked together, tick, tick, tick

  • mountain-eagle thank you very much!


    This means the plugin has been updated since I made the guide, which was fully tested at the time: there wasn't such option to create Borg ENV variables from the GUI.


    I will update the guide accordingly.

  • Hey there, I updated the guide with the changes that were required.. Thanks for your feedback.


    Heck I didn't realize I made it a long time ago and it was still featuring OMV5 UI! :)

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • Your guide is good and great to understand and was simple.

    Since discovering the borg variables and what they can do via GUI I have since changed the borg base to point to a HDD rather then the small SSD of the operating system the default locations of .config .data etc. But you need to have multiple instances of the same variable but pointing to different Repo's if you have multiple repo's running. Thank you for the quick response into resolving.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!