equivalent of ftp put and append in scp

北城以北 提交于 2019-12-09 05:23:14

问题


I have a legacy script which I am not able to understand.

The script is to transfer 4 files (2 ebcdic format files and 2 pdf files) in unix to mainframes through ftp.

ebcdic format file 1 is abc.xyz
ebcdic format file 2 is pqr.xyz
pdf file 1 is abc.pdf
pdf file 2 is pqr.pdf
mainframe file name is AM2P.BJCUN.SALCHG

The syntax of the command in the script is as below:

quote site recfm=fb
put /myfiles/abc.xyz AM2P.BJCUN.SALCHG
append /myfiles/abc.pdf AM2P.BJCUN.SALCHG
append /myfiles/pqr.xyz AM2P.BJCUN.SALCHG
append /myfiles/pqr.pdf AM2P.BJCUN.SALCHG

I want to achieve the same thing through SCP.

Could someone please tell what is the equivalent of put and append command of ftp in scp ??


回答1:


Put is just the normal scp

scp /path/to/source user@host:/path/to/target

Append only works with a little hack (and not with scp directly)

cat source | ssh user@host "cat >> /path/to/target"



回答2:


scp can not append (ssh can, but it is not always an option). You can copy remote file, append it locally and then put it back.



来源:https://stackoverflow.com/questions/9971490/equivalent-of-ftp-put-and-append-in-scp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!