Skip to main content

Download files

Download files from an SFTP server to a Linux system

To do this, we use the SFTP command in Linux. For our ORSANCO project, we download files from the SFTP NOAA server on to the Linux VM and process the files on the VM.

Here are the steps to do so,

  1. Run the command in your terminal on the VM
    sftp skshirsagar@data7.erh.noaa.gov
  2. Running this command, will prompt you to enter the password
  3. Enter the password and voila you are in the SFTP server
  4. You should see a sftp > prompt, if not, the credentials you have entered are incorect.
  5. Inside the sftp > prompt, set your lcd (local current directory) where you wish to save the files that you are downloading from the SFTP server.
  6. To do so, (in case of the ORSANCO VM, it was set to /dbdrive/orsanco)
    lcd /dbdrive/orsanco
  7. Once the lcd is set, use the get command to download the files you need.
    get filename

Download files from a Linux Server to your Local System

To achieve this task, we will use the scp command. Follow along,

  1. Have your SSH key handy and enter the following command in the terminal of your Local Sytem
    scp -i <path-to-private-key> <user>@<host>:<filename> <place-to-save-file-on-your-sys>
  2. In case of the ORSANCO VM, the command looks like this
    scp -i ~/.ssh/orsanco_flows_gqc.pem gqc@20.14.140.39:/dbdrive/orsanco/orsanco-backup-022823.sql /mnt/a/GQC/jacob/orsanco/dumps/
  3. The command above lets you download the SQL Dump created on the VM to your Local system.
  4. The download speeds achieved with scp are incredible and there is minimal latency.