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,
- Run the command in your terminal on the VM
sftp skshirsagar@data7.erh.noaa.gov - Running this command, will prompt you to enter the password
- Enter the password and voila you are in the SFTP server
- You should see a
sftp >prompt, if not, the credentials you have entered are incorect. - Inside the
sftp >prompt, set yourlcd(local current directory) where you wish to save the files that you are downloading from the SFTP server. - To do so, (in case of the ORSANCO VM, it was set to
/dbdrive/orsanco)lcd /dbdrive/orsanco - Once the
lcdis set, use thegetcommand 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,
- 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> - 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/ - The command above lets you download the SQL Dump created on the VM to your Local system.
- The download speeds achieved with
scpare incredible and there is minimal latency.