System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Can copy a file in a ftp session?

Fenglin
Regular Advisor

Can copy a file in a ftp session?

Hi

Is it possible to copy a file when one is in a ftp session?

I do a help. I can't see any commands which can copy files.

Regards
Feng Lin
17 REPLIES
Michal Kapalka (mikap)
Honored Contributor

Re: Can copy a file in a ftp session?

hi,

could you please get more detaild, what does mean to copy a file in FTP session ??

ftp commands can be found :

http://www.cs.colostate.edu/helpdocs/ftp.html

mikap
Steven Schweda
Honored Contributor

Re: Can copy a file in a ftp session?

Copy a file from where to where? On the
client or the server (or both)?

> [...] I can't see any commands which can
> copy files.

It _is_ called the File _Transfer_ Protocol,
not the File _Copy_ Protocol.
Fenglin
Regular Advisor

Re: Can copy a file in a ftp session?

Hi

What I meant was I already ftped to a server.
I am at a command prompt at a specific directory like the following
and I want to copy a file in the same directory. Is this possible?
ftp>


Regards
Feng Lin
Steven Schweda
Honored Contributor

Re: Can copy a file in a ftp session?

> [...] and I want to copy a file in the same
> directory.

On the server? I'll try again.

> Copy a file from where to where? [...]

Generally, an FTP server will not let an FTP
user execute arbitrary commands (like, say,
"cp").

> I do a help. [...]

What does "quote help" tell you?
Fenglin
Regular Advisor

Re: Can copy a file in a ftp session?

Hi Steven

WHen I do 'help', there is no 'cp' commands available. That is why I am wondering whether it is possible.

Regards
Feng Lin
Steven Schweda
Honored Contributor

Re: Can copy a file in a ftp session?

> WHen I do 'help' [...]

WHAT DID I ASK? "help" or "quote help"?
Did I ask what you _saw_ or what you
_thought_ about what you saw?

I don't know what this FTP server is. I
don't know what it can do or what it will do.
I can't talk to it. All I can do is talk to
you, but you don't seem to telling me
anything useful.
piyush mathiya
Trusted Contributor

Re: Can copy a file in a ftp session?

Hi Feng,

This is not possible, only the posibility is to use indirect way to do so...

ftp> get 1.txt
200 PORT command successful.
150 Opening BINARY mode data connection for 1.txt (44 bytes).
226 Transfer complete.
44 bytes received in 0.01 seconds (3.61 Kbytes/s)
ftp> put 1.txt
200 PORT command successful.
150 Opening BINARY mode data connection for 1.txt.
226 Transfer complete.



I know that this is not the way we should do...:)
Fenglin
Regular Advisor

Re: Can copy a file in a ftp session?

Hi piyush

Thanks for your answer.

You got my point though it does not solve my problem

Regards
Feng Lin
Steven Schweda
Honored Contributor

Re: Can copy a file in a ftp session?

> [...] only the posibility [...]

The word "only" is a dangerous thing.

man ftpd
or:

http://docs.hp.com/en/B2355-60130/ftpd.1M.html

Look for "SITE EXEC".

If I could get a straight answer to a simple
question, then I might be able to tell you if
you could use it. But apparently I can't.

> [...] it does not solve my problem

Hard to do with no useful information.
Steven Schweda
Honored Contributor

Re: Can copy a file in a ftp session?

> The word "only" is a dangerous thing.

alp $ ftp dy
220 dy.antinode.info FTP server (Version 1.1.214.4(PHNE_36129) Mon Apr 23 13:44:
14 GMT 2007) ready.
Connected to dy.antinode.info.
Name (dy.antinode.info:sms):
331 Password required for sms.
Password:
230 User sms logged in.
FTP> cd ftpt
250 CWD command successful.
FTP> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
total 16
-rw-r--r-- 1 sms sys 5 Dec 9 23:13 a_file

226 Transfer complete.
76 bytes received in 00:00:00.00 seconds (724.79 Mbytes/s)
FTP> quote site exec cp -p a_file copy_of_a_file
200-cp -p a_file copy_of_a_file
200 (end of 'cp -p a_file copy_of_a_file')
FTP> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
total 32
-rw-r--r-- 1 sms sys 5 Dec 9 23:13 a_file
-rw-r--r-- 1 sms sys 5 Dec 9 23:13 copy_of_a_file

226 Transfer complete.
150 bytes received in 00:00:00.00 seconds (1.40 Gbytes/s)
FTP> quote site exec uname -a
200-uname -a
200-HP-UX dy B.11.11 U 9000/785 2012616114 unlimited-user license
200 (end of 'uname -a')
FTP> quit
221 Goodbye.

Documentation on this stuff seems to be very
sparse, but, as usual, many things are
possible.
Fenglin
Regular Advisor

Re: Can copy a file in a ftp session?

Hi Steven

Thanks for your efforts. The server that I need to ftp to is not a HP-UX server. So on my side, your method does not work.

Anyway,my problem has been resolved in such a way that I don't need to do a copy.

Cheers
Feng Lin
Steven Schweda
Honored Contributor

Re: Can copy a file in a ftp session?

> The server that I need to ftp to is not a
> HP-UX server.

I tried to find this out, but as you may
recall,

> I don't know what this FTP server is.

I wasn't getting any help.

Note that wu-ftpd is available for systems
other than HP-UX, so "not HP-UX" is not
particularly useful information in this
context.

> Anyway,my problem has been resolved in such
> a way [...]

You're a man of many secrets.
Tingli
Esteemed Contributor

Re: Can copy a file in a ftp session?

You can use ! to execute shell command. For details, just go man ftp.

! [command [args]]
Invoke an interactive shell on the local machine. If there are arguments, the first is taken to be a
command to execute directly, with the rest of the arguments as its arguments.
Steven Schweda
Honored Contributor

Re: Can copy a file in a ftp session?

> You can use ! to execute shell command.
> For details, just go man ftp.

It never was really made clear (despite
repeated questions), but apparently the goal
was to do the copying on the FTP server, not
on the client.

Some forum users seem to be chronically
unable to pose a question well. These users
often seem to be unable to answer one,
either. This thread exhibits both problems,
making it largely a waste of space and time.
Fenglin
Regular Advisor

Re: Can copy a file in a ftp session?

Hi Steven

There was a misunderstanding with the issue that I need to solve. That is what happened exactly.

I don't feel that there is a need to share the exact details of what happened.

Another thing is you can choose not reply to my queries if you feel so disturbed.

Regards
Feng Lin
Steven Schweda
Honored Contributor

Re: Can copy a file in a ftp session?

> I don't feel that there is a need to share
> the exact details of what happened.

That's fair, but my memory is not so good.
Perhaps you could include a note with your
future questions saying that you didn't
intend to provide sufficient information, and
that you won't answer any questions. This
might save us all considerable time and
frustration. Thanks.
Fenglin
Regular Advisor

Re: Can copy a file in a ftp session?

I meant only you Steven, not the rest.

You can choose not to reply my queries in the future.I am very fine with that.

I specify 'you' in my last email. I think you don't even understand simple english.