Running a borg extract remotely

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












Consider that backups have been made to a remote repository, located on /mnt/backup on server.



For non-Borg users, a repository consists of multiple archives. A single archive is created every time a backup is made. Now, suppose I want to extract a specific archive - for simplicity, the most recent one.



The way I'm currently doing this is to get a list of archives from the remote repository, and then store their names in a mailarchives array. That looks like:



mapfile -t mailarchives < <(borg list --short 'faheem@server:/mnt/backup') 


Then I extract all the files from mailarchive[-1] (the most recent archive), to verify that the archive is valid and that I can restore from it. That looks like:



borg extract -n 'faheem@server:/mnt/backup'::"$mailarchives[-1]"


However, this uses colossal amounts of data to copy everything locally. So, my question is whether it's possible to do all this remotely, and only transmit the result (whether success or failure) locally via ssh. I think it should be possible, but I don't know exactly how.



An even simpler example is



borg check faheem@server:/mnt/backup


which for some reason also consumes lots of data.



Also, despite appearances, this question isn't really Borgbackup specific. It could be phrased more generally as: if I have want to run a check on a remote machine, but which normally requires a lot of data to be downloaded locally if I want to run the check locally, can I run this check remotely, and just pass the result of success or failure to local?



And finally, a note from Borg's main/lead developer:




ThomasWaldmann> faheem: borg returns 0 on success, 1 on warning, 2 on error.








share|improve this question

























    up vote
    2
    down vote

    favorite












    Consider that backups have been made to a remote repository, located on /mnt/backup on server.



    For non-Borg users, a repository consists of multiple archives. A single archive is created every time a backup is made. Now, suppose I want to extract a specific archive - for simplicity, the most recent one.



    The way I'm currently doing this is to get a list of archives from the remote repository, and then store their names in a mailarchives array. That looks like:



    mapfile -t mailarchives < <(borg list --short 'faheem@server:/mnt/backup') 


    Then I extract all the files from mailarchive[-1] (the most recent archive), to verify that the archive is valid and that I can restore from it. That looks like:



    borg extract -n 'faheem@server:/mnt/backup'::"$mailarchives[-1]"


    However, this uses colossal amounts of data to copy everything locally. So, my question is whether it's possible to do all this remotely, and only transmit the result (whether success or failure) locally via ssh. I think it should be possible, but I don't know exactly how.



    An even simpler example is



    borg check faheem@server:/mnt/backup


    which for some reason also consumes lots of data.



    Also, despite appearances, this question isn't really Borgbackup specific. It could be phrased more generally as: if I have want to run a check on a remote machine, but which normally requires a lot of data to be downloaded locally if I want to run the check locally, can I run this check remotely, and just pass the result of success or failure to local?



    And finally, a note from Borg's main/lead developer:




    ThomasWaldmann> faheem: borg returns 0 on success, 1 on warning, 2 on error.








    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Consider that backups have been made to a remote repository, located on /mnt/backup on server.



      For non-Borg users, a repository consists of multiple archives. A single archive is created every time a backup is made. Now, suppose I want to extract a specific archive - for simplicity, the most recent one.



      The way I'm currently doing this is to get a list of archives from the remote repository, and then store their names in a mailarchives array. That looks like:



      mapfile -t mailarchives < <(borg list --short 'faheem@server:/mnt/backup') 


      Then I extract all the files from mailarchive[-1] (the most recent archive), to verify that the archive is valid and that I can restore from it. That looks like:



      borg extract -n 'faheem@server:/mnt/backup'::"$mailarchives[-1]"


      However, this uses colossal amounts of data to copy everything locally. So, my question is whether it's possible to do all this remotely, and only transmit the result (whether success or failure) locally via ssh. I think it should be possible, but I don't know exactly how.



      An even simpler example is



      borg check faheem@server:/mnt/backup


      which for some reason also consumes lots of data.



      Also, despite appearances, this question isn't really Borgbackup specific. It could be phrased more generally as: if I have want to run a check on a remote machine, but which normally requires a lot of data to be downloaded locally if I want to run the check locally, can I run this check remotely, and just pass the result of success or failure to local?



      And finally, a note from Borg's main/lead developer:




      ThomasWaldmann> faheem: borg returns 0 on success, 1 on warning, 2 on error.








      share|improve this question













      Consider that backups have been made to a remote repository, located on /mnt/backup on server.



      For non-Borg users, a repository consists of multiple archives. A single archive is created every time a backup is made. Now, suppose I want to extract a specific archive - for simplicity, the most recent one.



      The way I'm currently doing this is to get a list of archives from the remote repository, and then store their names in a mailarchives array. That looks like:



      mapfile -t mailarchives < <(borg list --short 'faheem@server:/mnt/backup') 


      Then I extract all the files from mailarchive[-1] (the most recent archive), to verify that the archive is valid and that I can restore from it. That looks like:



      borg extract -n 'faheem@server:/mnt/backup'::"$mailarchives[-1]"


      However, this uses colossal amounts of data to copy everything locally. So, my question is whether it's possible to do all this remotely, and only transmit the result (whether success or failure) locally via ssh. I think it should be possible, but I don't know exactly how.



      An even simpler example is



      borg check faheem@server:/mnt/backup


      which for some reason also consumes lots of data.



      Also, despite appearances, this question isn't really Borgbackup specific. It could be phrased more generally as: if I have want to run a check on a remote machine, but which normally requires a lot of data to be downloaded locally if I want to run the check locally, can I run this check remotely, and just pass the result of success or failure to local?



      And finally, a note from Borg's main/lead developer:




      ThomasWaldmann> faheem: borg returns 0 on success, 1 on warning, 2 on error.










      share|improve this question












      share|improve this question




      share|improve this question








      edited May 17 at 9:11









      Kusalananda

      102k13199315




      102k13199315









      asked May 16 at 21:57









      Faheem Mitha

      22.1k1676131




      22.1k1676131

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f444250%2frunning-a-borg-extract-remotely%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f444250%2frunning-a-borg-extract-remotely%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?