How to SAVE a file from remote server to local machine?












2















I need to acquire data from a little computer (Red Pitaya-linux) and save it to an external PC because it is very large. Also, I do not want to save the file first and then copy it using ssh for the same reason. Should I insert a ssh into the acquire script?










share|improve this question




















  • 1





    I guess you would like to mount the drive from the external PC in a directory in the Red Pitaya-linux. Configure NFS sharing. The Red Pitaya-linux will use the shared directory as if it was a local directory.

    – Bruno Negrão Zica
    Jul 5 '16 at 4:16


















2















I need to acquire data from a little computer (Red Pitaya-linux) and save it to an external PC because it is very large. Also, I do not want to save the file first and then copy it using ssh for the same reason. Should I insert a ssh into the acquire script?










share|improve this question




















  • 1





    I guess you would like to mount the drive from the external PC in a directory in the Red Pitaya-linux. Configure NFS sharing. The Red Pitaya-linux will use the shared directory as if it was a local directory.

    – Bruno Negrão Zica
    Jul 5 '16 at 4:16
















2












2








2








I need to acquire data from a little computer (Red Pitaya-linux) and save it to an external PC because it is very large. Also, I do not want to save the file first and then copy it using ssh for the same reason. Should I insert a ssh into the acquire script?










share|improve this question
















I need to acquire data from a little computer (Red Pitaya-linux) and save it to an external PC because it is very large. Also, I do not want to save the file first and then copy it using ssh for the same reason. Should I insert a ssh into the acquire script?







file-transfer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 5 '16 at 3:20









Jeff Schaller

44.3k1162143




44.3k1162143










asked Jul 5 '16 at 1:27









Joan MendozaJoan Mendoza

112




112








  • 1





    I guess you would like to mount the drive from the external PC in a directory in the Red Pitaya-linux. Configure NFS sharing. The Red Pitaya-linux will use the shared directory as if it was a local directory.

    – Bruno Negrão Zica
    Jul 5 '16 at 4:16
















  • 1





    I guess you would like to mount the drive from the external PC in a directory in the Red Pitaya-linux. Configure NFS sharing. The Red Pitaya-linux will use the shared directory as if it was a local directory.

    – Bruno Negrão Zica
    Jul 5 '16 at 4:16










1




1





I guess you would like to mount the drive from the external PC in a directory in the Red Pitaya-linux. Configure NFS sharing. The Red Pitaya-linux will use the shared directory as if it was a local directory.

– Bruno Negrão Zica
Jul 5 '16 at 4:16







I guess you would like to mount the drive from the external PC in a directory in the Red Pitaya-linux. Configure NFS sharing. The Red Pitaya-linux will use the shared directory as if it was a local directory.

– Bruno Negrão Zica
Jul 5 '16 at 4:16












2 Answers
2






active

oldest

votes


















1














If I understand what you're asking, SFTP (https://www.freebsd.org/cgi/man.cgi?query=sftp&sektion=1) sounds like it would be your best bet to send a file from one server to another. The SCP command might also work, depending on how large the data is. You can use WinSCP, Filezilla, or just run it from the command line (usr/bin/sftp for most installs, but be sure to include IP/hostname:port).






share|improve this answer
























  • Neither sftp nor scp will solve the problem that the questioner does "not want to save the file first." Probably you misread the problem.

    – Dubu
    Jul 5 '16 at 7:44











  • Exactly, what kind of command would save the .dat into an external disk

    – Joan Mendoza
    Jul 12 '16 at 17:18











  • You can either use the sftp prompt/shell or you can create a batch file using the -b flag to run a single command or for scripting. example: /usr/bin/sftp -b ${file} -oPort=${sftp_port} ${sftp_ip}

    – SomeGuy
    Jul 12 '16 at 18:50





















1















Should I insert a ssh into the acquire script?




Probably yes.



If whatever you run on your little computer to collect data prints to stdout (or can be made to do so), you can just run it with ssh and redirect stdout on the local machine to a file.



e.g.



ssh user@redpitaya 'data-gathering-script-or-command' > localfile


If the output is huge, and/or you connect to it via an expensive network connection, you can save time (and maybe money) by compressing stdout on the little machine.



e.g.



ssh user@redpitaya 'data-gathering-script-or-command | gzip' > localfile.gz


or



ssh user@redpitaya 'data-gathering-script-or-command | gzip' | 
gzip -d > localfile


Alternatively, you can use xz or lzma or any other compression tool instead of gzip.



NOTE: You're using CPU time on the little machine to minimise network traffic. Be careful not to overload the little box if it has a tiny, under-powered CPU.






share|improve this answer


























    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    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%2f293906%2fhow-to-save-a-file-from-remote-server-to-local-machine%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    If I understand what you're asking, SFTP (https://www.freebsd.org/cgi/man.cgi?query=sftp&sektion=1) sounds like it would be your best bet to send a file from one server to another. The SCP command might also work, depending on how large the data is. You can use WinSCP, Filezilla, or just run it from the command line (usr/bin/sftp for most installs, but be sure to include IP/hostname:port).






    share|improve this answer
























    • Neither sftp nor scp will solve the problem that the questioner does "not want to save the file first." Probably you misread the problem.

      – Dubu
      Jul 5 '16 at 7:44











    • Exactly, what kind of command would save the .dat into an external disk

      – Joan Mendoza
      Jul 12 '16 at 17:18











    • You can either use the sftp prompt/shell or you can create a batch file using the -b flag to run a single command or for scripting. example: /usr/bin/sftp -b ${file} -oPort=${sftp_port} ${sftp_ip}

      – SomeGuy
      Jul 12 '16 at 18:50


















    1














    If I understand what you're asking, SFTP (https://www.freebsd.org/cgi/man.cgi?query=sftp&sektion=1) sounds like it would be your best bet to send a file from one server to another. The SCP command might also work, depending on how large the data is. You can use WinSCP, Filezilla, or just run it from the command line (usr/bin/sftp for most installs, but be sure to include IP/hostname:port).






    share|improve this answer
























    • Neither sftp nor scp will solve the problem that the questioner does "not want to save the file first." Probably you misread the problem.

      – Dubu
      Jul 5 '16 at 7:44











    • Exactly, what kind of command would save the .dat into an external disk

      – Joan Mendoza
      Jul 12 '16 at 17:18











    • You can either use the sftp prompt/shell or you can create a batch file using the -b flag to run a single command or for scripting. example: /usr/bin/sftp -b ${file} -oPort=${sftp_port} ${sftp_ip}

      – SomeGuy
      Jul 12 '16 at 18:50
















    1












    1








    1







    If I understand what you're asking, SFTP (https://www.freebsd.org/cgi/man.cgi?query=sftp&sektion=1) sounds like it would be your best bet to send a file from one server to another. The SCP command might also work, depending on how large the data is. You can use WinSCP, Filezilla, or just run it from the command line (usr/bin/sftp for most installs, but be sure to include IP/hostname:port).






    share|improve this answer













    If I understand what you're asking, SFTP (https://www.freebsd.org/cgi/man.cgi?query=sftp&sektion=1) sounds like it would be your best bet to send a file from one server to another. The SCP command might also work, depending on how large the data is. You can use WinSCP, Filezilla, or just run it from the command line (usr/bin/sftp for most installs, but be sure to include IP/hostname:port).







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 5 '16 at 2:26









    SomeGuySomeGuy

    232112




    232112













    • Neither sftp nor scp will solve the problem that the questioner does "not want to save the file first." Probably you misread the problem.

      – Dubu
      Jul 5 '16 at 7:44











    • Exactly, what kind of command would save the .dat into an external disk

      – Joan Mendoza
      Jul 12 '16 at 17:18











    • You can either use the sftp prompt/shell or you can create a batch file using the -b flag to run a single command or for scripting. example: /usr/bin/sftp -b ${file} -oPort=${sftp_port} ${sftp_ip}

      – SomeGuy
      Jul 12 '16 at 18:50





















    • Neither sftp nor scp will solve the problem that the questioner does "not want to save the file first." Probably you misread the problem.

      – Dubu
      Jul 5 '16 at 7:44











    • Exactly, what kind of command would save the .dat into an external disk

      – Joan Mendoza
      Jul 12 '16 at 17:18











    • You can either use the sftp prompt/shell or you can create a batch file using the -b flag to run a single command or for scripting. example: /usr/bin/sftp -b ${file} -oPort=${sftp_port} ${sftp_ip}

      – SomeGuy
      Jul 12 '16 at 18:50



















    Neither sftp nor scp will solve the problem that the questioner does "not want to save the file first." Probably you misread the problem.

    – Dubu
    Jul 5 '16 at 7:44





    Neither sftp nor scp will solve the problem that the questioner does "not want to save the file first." Probably you misread the problem.

    – Dubu
    Jul 5 '16 at 7:44













    Exactly, what kind of command would save the .dat into an external disk

    – Joan Mendoza
    Jul 12 '16 at 17:18





    Exactly, what kind of command would save the .dat into an external disk

    – Joan Mendoza
    Jul 12 '16 at 17:18













    You can either use the sftp prompt/shell or you can create a batch file using the -b flag to run a single command or for scripting. example: /usr/bin/sftp -b ${file} -oPort=${sftp_port} ${sftp_ip}

    – SomeGuy
    Jul 12 '16 at 18:50







    You can either use the sftp prompt/shell or you can create a batch file using the -b flag to run a single command or for scripting. example: /usr/bin/sftp -b ${file} -oPort=${sftp_port} ${sftp_ip}

    – SomeGuy
    Jul 12 '16 at 18:50















    1















    Should I insert a ssh into the acquire script?




    Probably yes.



    If whatever you run on your little computer to collect data prints to stdout (or can be made to do so), you can just run it with ssh and redirect stdout on the local machine to a file.



    e.g.



    ssh user@redpitaya 'data-gathering-script-or-command' > localfile


    If the output is huge, and/or you connect to it via an expensive network connection, you can save time (and maybe money) by compressing stdout on the little machine.



    e.g.



    ssh user@redpitaya 'data-gathering-script-or-command | gzip' > localfile.gz


    or



    ssh user@redpitaya 'data-gathering-script-or-command | gzip' | 
    gzip -d > localfile


    Alternatively, you can use xz or lzma or any other compression tool instead of gzip.



    NOTE: You're using CPU time on the little machine to minimise network traffic. Be careful not to overload the little box if it has a tiny, under-powered CPU.






    share|improve this answer






























      1















      Should I insert a ssh into the acquire script?




      Probably yes.



      If whatever you run on your little computer to collect data prints to stdout (or can be made to do so), you can just run it with ssh and redirect stdout on the local machine to a file.



      e.g.



      ssh user@redpitaya 'data-gathering-script-or-command' > localfile


      If the output is huge, and/or you connect to it via an expensive network connection, you can save time (and maybe money) by compressing stdout on the little machine.



      e.g.



      ssh user@redpitaya 'data-gathering-script-or-command | gzip' > localfile.gz


      or



      ssh user@redpitaya 'data-gathering-script-or-command | gzip' | 
      gzip -d > localfile


      Alternatively, you can use xz or lzma or any other compression tool instead of gzip.



      NOTE: You're using CPU time on the little machine to minimise network traffic. Be careful not to overload the little box if it has a tiny, under-powered CPU.






      share|improve this answer




























        1












        1








        1








        Should I insert a ssh into the acquire script?




        Probably yes.



        If whatever you run on your little computer to collect data prints to stdout (or can be made to do so), you can just run it with ssh and redirect stdout on the local machine to a file.



        e.g.



        ssh user@redpitaya 'data-gathering-script-or-command' > localfile


        If the output is huge, and/or you connect to it via an expensive network connection, you can save time (and maybe money) by compressing stdout on the little machine.



        e.g.



        ssh user@redpitaya 'data-gathering-script-or-command | gzip' > localfile.gz


        or



        ssh user@redpitaya 'data-gathering-script-or-command | gzip' | 
        gzip -d > localfile


        Alternatively, you can use xz or lzma or any other compression tool instead of gzip.



        NOTE: You're using CPU time on the little machine to minimise network traffic. Be careful not to overload the little box if it has a tiny, under-powered CPU.






        share|improve this answer
















        Should I insert a ssh into the acquire script?




        Probably yes.



        If whatever you run on your little computer to collect data prints to stdout (or can be made to do so), you can just run it with ssh and redirect stdout on the local machine to a file.



        e.g.



        ssh user@redpitaya 'data-gathering-script-or-command' > localfile


        If the output is huge, and/or you connect to it via an expensive network connection, you can save time (and maybe money) by compressing stdout on the little machine.



        e.g.



        ssh user@redpitaya 'data-gathering-script-or-command | gzip' > localfile.gz


        or



        ssh user@redpitaya 'data-gathering-script-or-command | gzip' | 
        gzip -d > localfile


        Alternatively, you can use xz or lzma or any other compression tool instead of gzip.



        NOTE: You're using CPU time on the little machine to minimise network traffic. Be careful not to overload the little box if it has a tiny, under-powered CPU.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 5 '16 at 6:04

























        answered Jul 5 '16 at 5:53









        cascas

        39.5k455103




        39.5k455103






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f293906%2fhow-to-save-a-file-from-remote-server-to-local-machine%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to make a Squid Proxy server?

            Is this a new Fibonacci Identity?

            19世紀