ncrcat command regarding sftp server – in #13: Postprocessing

in #13: Postprocessing

<p> Dear colleagues, I have an issue with remote processing of my <span class="caps"> COSMO </span> - <span class="caps"> CLM </span> output data. I have a remote <span class="caps"> NAS </span> (Network Attached Storage), there are many <span class="caps"> COSMO </span> - <span class="caps"> CLM </span> output data (many lffd*.nc files) and there is no possibility to install <span class="caps"> NCO </span> at <span class="caps"> NAS </span> . This <span class="caps"> NAS </span> has an sftp address and connection, I can connect it using simple sftp in Linux (sftp login_name@ip_address, then password). However, what I would like to do, is to postprocess these lffd*.nc data remotely, e.g., I would like to run <span class="caps"> NCO </span> command (e.g., ncrcat) on my local computer to get the ncrcat-ted file locally using the sftp access to my <span class="caps"> NAS </span> . I have read the <span class="caps"> NCO </span> sourceforge Userguide and tried many variants, however, I haven’t any success. </p> <p> I have tried the following commands (and many similar ones) and got the following results: </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996*.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> Connected to 192.168.1.58. <br/> Multiple source paths, but destination “./lffd1996*.nc” is not a directory <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . vplatonv@192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> scp: /DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc: No such file or directory <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon -H -p sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02 -l . lffd*.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> Connected to 192.168.1.58. <br/> Multiple source paths, but destination “./lffd*.nc” is not a directory <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon -p sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02 -l . lffd*.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> Connected to 192.168.1.58. <br/> Multiple source paths, but destination “./lffd*.nc” is not a directory <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/* -l . -o T_2M.nc <br/> usage: sftp [-46aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher] [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-R num_requests] [-S program] [-s subsystem | sftp_server] destination <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/* -o T_2M.nc <br/> usage: sftp [-46aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher] [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-R num_requests] [-S program] [-s subsystem | sftp_server] destination <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> The following commands (and many similar ones) didn’t get any results and any errors: </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc </p> <p> ncrcat -h -O -v T_2M,lat,lon -H -p sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc -l . -o T_2M.nc </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc </p> <p> There is the only command which worked somehow: </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> Connected to 192.168.1.58. <br/> Fetching /DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc to ./lffd1996010100.nc <br/> /DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc 52% 61MB 3.9MB/s 00:14 <span class="caps"> ETA </span> </p> <p> However, there is not necessary to operate the single lffd file, I need to operate multiple files. Excuse me for a lot of examples, code and logs. <br/> So, does anyone have some experience in operating <span class="caps"> NCO </span> via sftp having <span class="caps"> NCO </span> on local machine and aiming to operate remote machine without <span class="caps"> NCO </span> ? I would be very grateful for any hints in this case. Thanks a lot! </p>

  @vladimirplatonov in #f6fe798

<p> Dear colleagues, I have an issue with remote processing of my <span class="caps"> COSMO </span> - <span class="caps"> CLM </span> output data. I have a remote <span class="caps"> NAS </span> (Network Attached Storage), there are many <span class="caps"> COSMO </span> - <span class="caps"> CLM </span> output data (many lffd*.nc files) and there is no possibility to install <span class="caps"> NCO </span> at <span class="caps"> NAS </span> . This <span class="caps"> NAS </span> has an sftp address and connection, I can connect it using simple sftp in Linux (sftp login_name@ip_address, then password). However, what I would like to do, is to postprocess these lffd*.nc data remotely, e.g., I would like to run <span class="caps"> NCO </span> command (e.g., ncrcat) on my local computer to get the ncrcat-ted file locally using the sftp access to my <span class="caps"> NAS </span> . I have read the <span class="caps"> NCO </span> sourceforge Userguide and tried many variants, however, I haven’t any success. </p> <p> I have tried the following commands (and many similar ones) and got the following results: </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996*.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> Connected to 192.168.1.58. <br/> Multiple source paths, but destination “./lffd1996*.nc” is not a directory <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . vplatonv@192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> scp: /DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc: No such file or directory <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon -H -p sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02 -l . lffd*.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> Connected to 192.168.1.58. <br/> Multiple source paths, but destination “./lffd*.nc” is not a directory <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon -p sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02 -l . lffd*.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> Connected to 192.168.1.58. <br/> Multiple source paths, but destination “./lffd*.nc” is not a directory <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/* -l . -o T_2M.nc <br/> usage: sftp [-46aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher] [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-R num_requests] [-S program] [-s subsystem | sftp_server] destination <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/* -o T_2M.nc <br/> usage: sftp [-46aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher] [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-R num_requests] [-S program] [-s subsystem | sftp_server] destination <br/> ncrcat: <span class="caps"> ERROR </span> Synchronous fetch command failed </p> <p> The following commands (and many similar ones) didn’t get any results and any errors: </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc </p> <p> ncrcat -h -O -v T_2M,lat,lon -H -p sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc -l . -o T_2M.nc </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc </p> <p> There is the only command which worked somehow: </p> <p> ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc -o T_2M.nc <br/> vplatonv@192.168.1.58’s password: <br/> Connected to 192.168.1.58. <br/> Fetching /DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc to ./lffd1996010100.nc <br/> /DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc 52% 61MB 3.9MB/s 00:14 <span class="caps"> ETA </span> </p> <p> However, there is not necessary to operate the single lffd file, I need to operate multiple files. Excuse me for a lot of examples, code and logs. <br/> So, does anyone have some experience in operating <span class="caps"> NCO </span> via sftp having <span class="caps"> NCO </span> on local machine and aiming to operate remote machine without <span class="caps"> NCO </span> ? I would be very grateful for any hints in this case. Thanks a lot! </p>

ncrcat command regarding sftp server

Dear colleagues, I have an issue with remote processing of my COSMO - CLM output data. I have a remote NAS (Network Attached Storage), there are many COSMO - CLM output data (many lffd*.nc files) and there is no possibility to install NCO at NAS . This NAS has an sftp address and connection, I can connect it using simple sftp in Linux (sftp login_name@ip_address, then password). However, what I would like to do, is to postprocess these lffd*.nc data remotely, e.g., I would like to run NCO command (e.g., ncrcat) on my local computer to get the ncrcat-ted file locally using the sftp access to my NAS . I have read the NCO sourceforge Userguide and tried many variants, however, I haven’t any success.

I have tried the following commands (and many similar ones) and got the following results:

ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996*.nc -o T_2M.nc
vplatonv@192.168.1.58’s password:
Connected to 192.168.1.58.
Multiple source paths, but destination “./lffd1996*.nc” is not a directory
ncrcat: ERROR Synchronous fetch command failed

ncrcat -h -O -v T_2M,lat,lon -l . vplatonv@192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc -o T_2M.nc
vplatonv@192.168.1.58’s password:
scp: /DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc: No such file or directory
ncrcat: ERROR Synchronous fetch command failed

ncrcat -h -O -v T_2M,lat,lon -H -p sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02 -l . lffd*.nc -o T_2M.nc
vplatonv@192.168.1.58’s password:
Connected to 192.168.1.58.
Multiple source paths, but destination “./lffd*.nc” is not a directory
ncrcat: ERROR Synchronous fetch command failed

ncrcat -h -O -v T_2M,lat,lon -p sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02 -l . lffd*.nc -o T_2M.nc
vplatonv@192.168.1.58’s password:
Connected to 192.168.1.58.
Multiple source paths, but destination “./lffd*.nc” is not a directory
ncrcat: ERROR Synchronous fetch command failed

ncrcat -h -O -v T_2M,lat,lon sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/* -l . -o T_2M.nc
usage: sftp [-46aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher] [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-R num_requests] [-S program] [-s subsystem | sftp_server] destination
ncrcat: ERROR Synchronous fetch command failed

ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/* -o T_2M.nc
usage: sftp [-46aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher] [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-R num_requests] [-S program] [-s subsystem | sftp_server] destination
ncrcat: ERROR Synchronous fetch command failed

The following commands (and many similar ones) didn’t get any results and any errors:

ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc

ncrcat -h -O -v T_2M,lat,lon -H -p sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd*.nc -l . -o T_2M.nc

ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc

There is the only command which worked somehow:

ncrcat -h -O -v T_2M,lat,lon -l . sftp://192.168.1.58:/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc -o T_2M.nc
vplatonv@192.168.1.58’s password:
Connected to 192.168.1.58.
Fetching /DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc to ./lffd1996010100.nc
/DATA/OUT_Arctic_5.05_final_1996/out02/lffd1996010100.nc 52% 61MB 3.9MB/s 00:14 ETA

However, there is not necessary to operate the single lffd file, I need to operate multiple files. Excuse me for a lot of examples, code and logs.
So, does anyone have some experience in operating NCO via sftp having NCO on local machine and aiming to operate remote machine without NCO ? I would be very grateful for any hints in this case. Thanks a lot!

View in channel
<p> I have never tried this. Since it is very <span class="caps"> NCO </span> specific, you may pose your question on the web site <br/> https://sourceforge.net/p/nco/discussion/9830/ </p>

  @burkhardtrockel in #b5daac1

<p> I have never tried this. Since it is very <span class="caps"> NCO </span> specific, you may pose your question on the web site <br/> https://sourceforge.net/p/nco/discussion/9830/ </p>

I have never tried this. Since it is very NCO specific, you may pose your question on the web site
https://sourceforge.net/p/nco/discussion/9830/

<p> I have also no idea how that could work, but is there a reason why you don’t mount your <span class="caps"> NAS </span> on your computer and then access the files directly? </p>

  @christiansteger in #d052e9c

<p> I have also no idea how that could work, but is there a reason why you don’t mount your <span class="caps"> NAS </span> on your computer and then access the files directly? </p>

I have also no idea how that could work, but is there a reason why you don’t mount your NAS on your computer and then access the files directly?

<p> Dear colleagues, thanks for your replies and recommendations, I have posted this question on the <span class="caps"> NCO </span> Sourceforge Forum. My reason to organize <span class="caps"> NAS </span> was to share <span class="caps"> COSMO </span> - <span class="caps"> CLM </span> data with other users, which is much more useful via sftp access. Moreover, I have a personal notebook, which is not applicable for stationary direct access the files on <span class="caps"> NAS </span> . Therefore, I have organized <span class="caps"> NAS </span> and <span class="caps"> SFTP </span> access to data on <span class="caps"> NAS </span> , and would like to operate these data remotely using <span class="caps"> NCO </span> . </p>

  @vladimirplatonov in #b7a9a05

<p> Dear colleagues, thanks for your replies and recommendations, I have posted this question on the <span class="caps"> NCO </span> Sourceforge Forum. My reason to organize <span class="caps"> NAS </span> was to share <span class="caps"> COSMO </span> - <span class="caps"> CLM </span> data with other users, which is much more useful via sftp access. Moreover, I have a personal notebook, which is not applicable for stationary direct access the files on <span class="caps"> NAS </span> . Therefore, I have organized <span class="caps"> NAS </span> and <span class="caps"> SFTP </span> access to data on <span class="caps"> NAS </span> , and would like to operate these data remotely using <span class="caps"> NCO </span> . </p>

Dear colleagues, thanks for your replies and recommendations, I have posted this question on the NCO Sourceforge Forum. My reason to organize NAS was to share COSMO - CLM data with other users, which is much more useful via sftp access. Moreover, I have a personal notebook, which is not applicable for stationary direct access the files on NAS . Therefore, I have organized NAS and SFTP access to data on NAS , and would like to operate these data remotely using NCO .

<p> Dear Vladimir, </p> <p> Usually I put file list as argument to the commands, for example in bash I generate an array of file names: </p> <p> #loop after all files – make array of directory+files names <br/> for ((i=0;i <cnt;i++)); do="" member_files[i]="”${members[i]}$f“&lt;br"> </cnt;i++));> done </p> <p> and the array is argument to the command: </p> <p> ncecat ${member_files[*]} /users/kdm/plgajacz/tmp/cat_tmp </p> <p> but I see in <span class="caps"> NCO </span> documentation different solution: </p> <ol> <li> Use xargs to transfer filenames on the command line <br/> /bin/ls | grep ${CASEID}_’……’.nc | xargs -x ncecat -o foo.nc </li> </ol> <p> Cheers <br/> Adam </p>

  @adamjaczewski in #16907a3

<p> Dear Vladimir, </p> <p> Usually I put file list as argument to the commands, for example in bash I generate an array of file names: </p> <p> #loop after all files – make array of directory+files names <br/> for ((i=0;i <cnt;i++)); do="" member_files[i]="”${members[i]}$f“&lt;br"> </cnt;i++));> done </p> <p> and the array is argument to the command: </p> <p> ncecat ${member_files[*]} /users/kdm/plgajacz/tmp/cat_tmp </p> <p> but I see in <span class="caps"> NCO </span> documentation different solution: </p> <ol> <li> Use xargs to transfer filenames on the command line <br/> /bin/ls | grep ${CASEID}_’……’.nc | xargs -x ncecat -o foo.nc </li> </ol> <p> Cheers <br/> Adam </p>

Dear Vladimir,

Usually I put file list as argument to the commands, for example in bash I generate an array of file names:

#loop after all files – make array of directory+files names
for ((i=0;i done

and the array is argument to the command:

ncecat ${member_files[*]} /users/kdm/plgajacz/tmp/cat_tmp

but I see in NCO documentation different solution:

  1. Use xargs to transfer filenames on the command line
    /bin/ls | grep ${CASEID}_’……’.nc | xargs -x ncecat -o foo.nc

Cheers
Adam

<p> Dear colleagues, thank you for feedback and help. I have partially solved my problem and would like to share this solution for further users and applicatons. Detailed answer and useful links were provided by Charlie Zender on the <span class="caps"> NCO </span> forum: [[https://sourceforge.net/p/nco/discussion/9830/thread/74d094c06c/?limit=25]]. One of links contained a hint by Adam, thanks a lot! </p>

  @vladimirplatonov in #b794130

<p> Dear colleagues, thank you for feedback and help. I have partially solved my problem and would like to share this solution for further users and applicatons. Detailed answer and useful links were provided by Charlie Zender on the <span class="caps"> NCO </span> forum: [[https://sourceforge.net/p/nco/discussion/9830/thread/74d094c06c/?limit=25]]. One of links contained a hint by Adam, thanks a lot! </p>

Dear colleagues, thank you for feedback and help. I have partially solved my problem and would like to share this solution for further users and applicatons. Detailed answer and useful links were provided by Charlie Zender on the NCO forum: [[https://sourceforge.net/p/nco/discussion/9830/thread/74d094c06c/?limit=25]]. One of links contained a hint by Adam, thanks a lot!