Is it possible to copy files through ftp connection? - ftp

I use the following code to put a file from my local machine to a remote machine:
open abc
a
b
lcd C:\Interfaces\KGR-ARV\XML
ascii
prompt
prompt
cd /usr/qkreditnethome/interface/temp
put C:\Interfaces\KGR-ARV\XML\*KGRRequest*QUA.XML
Y
quit
bye
Is there a way, using a ftp command, to copy the file from /usr/qkreditnethome/interface/temp to /usr/qkreditnethome/interface/temp2 ?
Thanks in advance!

There is no copy command in ftp. You will have to GET the file and PUT it where you want.

Depending on the OS you can take some third-party software which mounts the remote FTP as a part of the local filesystem, and then use regular system copy routines.

Related

How to run batch file after file download (from Linux to Windows) throught FTP in Windows

I am doing file copy from Linux to Windows share through FTP.
Once copy is done I am moving it to isilon storage which is shared on network path (manually).
Now I have created a batch file, which will do copy from FTP shared path to network path.
So how can I start batch file after FTP download? How can I automate it completely?
from Linux
ftp -n ip
user "user" "pwd"
put app.tar.gz
Once it is done i want to move it network shared path
Just use the copy command in a batch file, after the ftp.exe finishes:
ftp.exe -s:download.txt
copy c:\dowloadtarget\myfile.txt \\server\share\target\myfile.txt
You can run the copy even from the FTP script (the download.txt), if you need it for some reason. Use the ! (escape to shell) command.
get /remote/path/myfile.txt c:\dowloadtarget\myfile.txt
! copy c:\dowloadtarget\myfile.txt \\server\share\target\myfile.txt
But why don't you download the file directly to the shared folder?
get /remote/path/myfile.txt \\server\share\target\myfile.txt

How to write command in windows batch file to copy a zip file from an FTP path to a local folder in my computer

I want to copy a zip file from an FTP path to a local folder in my computer.
My client previously used coreftp.exe for that purpose. But now he ask us to use ftp.exe [default in windows machine, available at C:\Windows\System32\ftp.exe] for that purpose. The ftp is in the format :
ftp://username#ftpserver.address.com
And want to download it to d:\sample\docs folder on my machine.
I want that in a batch file so that I can schedule it through windows task manager.
So could you please help me to write that command on the batch file.
Thanks a lot in advance.
FTP.EXE is capable of executing script files. So you could just put this into your bat file:
#ECHO OFF
CD d:\sample\docs
FTP -v -i -s:C:\some\path\ftpscript.txt
And something like this into your ftpscript.txt:
open ftp://ftpserver.address.com
username
password
cd myfolder
get some_zip_file.zip
disconnect
bye
This will download some_zip_file.zip into the current directory (d:\sample\docs).

In FTP, how do I copy a remote file to other directories

Using FTP commands I want to upload a large file once and then copy that file to many directories on the remote FTP server. All the copy commands seems to relate to copying from local to remote or the other way around.
Is there an FTP command to copy remote to remote?
are you trying to move the file? if yes, you can do it using rename command to move the file, as for copy i guess you still have to do the the get,send from local-remote way.
as for move command should be something like this
rename /oldpath/file2move.txt /newpath/file2move.txt
Basically just rename your file path that is infront of the file that you wish to move.
As far as I know, there is no such command available in FTP protocol. There are some extensions to SFTP protocol to do this (and, having SSH access, you can issue cp commands), but SFTP is not an FTP.

how to copy whole directories using FTP commands

Anyone know how to put whole directories from local to another server using FTP command?
i had use mput , but it just transfer file only.
cd /images_temp --> ws_ftp virtual folder name
mput *.IMG --> just transfer multiple file
anyone can teach me what command i need to use to transfer whole directories?
thanks
You can use mput * or mget *. Confirm with a rather than y. You can change the prompting behavior using the prompt command. You will find more information in the manual page. In a unix environment, man ftp
You can iterate and decent into directories and use mput *.IMG but that would probably inefficient. Consider using ncftpput where you can upload the directory remotely with just one line.

scp upload file: no such file or directory

I'm using ssh to connect with a linux server. I'm trying to upload a file from my own computer(windows7) to linux.
When I type scp Desktop/H5.txt xxUserNamexx#mumble-39.xxServerNamexxx:/u/private/
I got following error:
scp Desktop/H5.txt xxUserNamexx#mumble-39.xxxServerNamexxxx:/u/private/
Desktop/H5.txt: No such file or directory
I can guarantee the server name and the file directory is correct. It seems that scp cannot find my file on my local computer.
What's the default path? What path should I type if the file I'm intending to upload is on my desktop?
Thank you
winscp is a nice option to copy files from MS to *nix. Also pscp is useful. SCP have known issues when used between MS and nix. There seems to be some misunderstanding of folder structure by scp.
drap the H5.txt from desktop to you cmd windows, this can avoid you type the wrong path
In the future you could try using winscp when you're dealing with small files. Also I think a cygwin scp should work just fine.
The slashes are incorrect. On Windows, it should be (assuming you are running Command Prompt from your Home directory):
C:\Users\user> scp Desktop\H5.txt junjue#mumble-39.xxServerNamexxx:/u/j/u/junjue/private/

Resources