[SLE] command line ftp copy
Does SUSE 10 come with a command line ftp copy command. I mean that I can copy a file from the local system to a remote ftp location, giving all info on the command line. Oddly, the ftp client I see in 10.0 allows this when copying from a remote server, but not when copying to a remote server. This works (copies remfile to the local machine): ftp user:pass@ftp.remote.com:/remfile . but this does not ftp remfile user:pass@ftp.remote.com:/ The error I get is: ftp: Unknown port `user:pass@ftp.remote.com', using port 21 ftp: Name or service not known I think is is a bug in that is is parsing the : as though it separates a host and port, when it is separating a user and password. It seems to make no difference how I specify the remote system: including the user:pass part fails. -- Roger Oberholtzer OPQ Systems AB Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Tel: Int +46 8-615 60 20 Fax: Int +46 8-31 42 23 -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Monday 19 June 2006 10:31, Roger Oberholtzer wrote:
I think is is a bug in that is is parsing the : as though it separates a host and port, when it is separating a user and password. It seems to make no difference how I specify the remote system: including the user:pass part fails.
Have you tried 'man ftp'? - Carl -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Mon, 2006-06-19 at 10:38 -0400, Carl Hartung wrote:
On Monday 19 June 2006 10:31, Roger Oberholtzer wrote:
I think is is a bug in that is is parsing the : as though it separates a host and port, when it is separating a user and password. It seems to make no difference how I specify the remote system: including the user:pass part fails.
Have you tried 'man ftp'? - Carl
Always my first step. That is where I found the user:password for use on the command line. The man page does not say that this is only allowed as part of copy to a remote system. Or at least it does not state so plainly in simple words.
-- Roger Oberholtzer OPQ Systems AB Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Tel: Int +46 8-615 60 20 Fax: Int +46 8-31 42 23 -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Monday 19 June 2006 16:52, Roger Oberholtzer wrote:
On Mon, 2006-06-19 at 10:38 -0400, Carl Hartung wrote:
On Monday 19 June 2006 10:31, Roger Oberholtzer wrote:
I think is is a bug in that is is parsing the : as though it separates a host and port, when it is separating a user and password. It seems to make no difference how I specify the remote system: including the user:pass part fails.
Have you tried 'man ftp'? - Carl
Always my first step. That is where I found the user:password for use on the command line. The man page does not say that this is only allowed as part of copy to a remote system. Or at least it does not state so plainly in simple words.
Have a look at the -u parameter to ftp -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Mon, 2006-06-19 at 20:50 +0200, Anders Johansson wrote:
On Monday 19 June 2006 16:52, Roger Oberholtzer wrote:
On Mon, 2006-06-19 at 10:38 -0400, Carl Hartung wrote:
On Monday 19 June 2006 10:31, Roger Oberholtzer wrote:
I think is is a bug in that is is parsing the : as though it separates a host and port, when it is separating a user and password. It seems to make no difference how I specify the remote system: including the user:pass part fails.
Have you tried 'man ftp'? - Carl
Always my first step. That is where I found the user:password for use on the command line. The man page does not say that this is only allowed as part of copy to a remote system. Or at least it does not state so plainly in simple words.
Have a look at the -u parameter to ftp
Ahh. Missed that one. It works if I do the command as; ftp -u ftp://user:password@remote.com/ local_file This is unintuitive in that the destination is given before the source file name. I was trying it like cp/ssh and such. Thanks for the info. -- Roger Oberholtzer OPQ Systems AB Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Tel: Int +46 8-615 60 20 Fax: Int +46 8-31 42 23 -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Roger Oberholtzer wrote:
Does SUSE 10 come with a command line ftp copy command. I mean that I can copy a file from the local system to a remote ftp location, giving all info on the command line.
I think you'll have to use some stdin input to do the PUT command. I have automated ftp stuff before, but I don't think I've ever managed to put everything on the command-line.
Oddly, the ftp client I see in 10.0 allows this when copying from a remote server, but not when copying to a remote server. This works (copies remfile to the local machine):
This is the AUTO-FETCH feature.
but this does not ftp remfile user:pass@ftp.remote.com:/
I don't think that is a supported format. At least not according to the manpage. /Per Jessen, Zürich -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Not sure if this helps you, but much can be done in a shell
script. Following is one that I use every day. (isn't pretty,
but works) It is run from a LInux box and does the following:
1. Obtains files from a VMS Alpha box and writes
them to a directory on the Linux box
2. Logs on to a MS Win box, deletes specific files, and
then copies the Linux files to the MS box.
Note: the "m" in mget, mdelete, and mput = multiple
Perhaps this will inspire your creative process. Wish I
had more time to help but I am swamped. good luck
Rich
-------------------
#!/bin/bash
RMT_HOST=192.xxx.xxx.xxx
RMT_USERID=system
RMT_PASSWORD=xxxxxxxx
RMT_DIR='dsa0:[temp]'
ftp -n -i -v -d <
Roger Oberholtzer wrote:
Does SUSE 10 come with a command line ftp copy command. I mean that I can copy a file from the local system to a remote ftp location, giving all info on the command line.
I think you'll have to use some stdin input to do the PUT command. I have automated ftp stuff before, but I don't think I've ever managed to put everything on the command-line.
Oddly, the ftp client I see in 10.0 allows this when copying from a remote server, but not when copying to a remote server. This works (copies remfile to the local machine):
This is the AUTO-FETCH feature.
but this does not ftp remfile user:pass@ftp.remote.com:/
I don't think that is a supported format. At least not according to the manpage.
/Per Jessen, Zürich
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
-- TNS -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Richard Mancusi wrote:
Not sure if this helps you, but much can be done in a shell script. [snip - Richards examples]
Yep, this is exactly what I was talking about - pretty much what I did a few years back. /Per Jessen, Zürich -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Monday 2006-06-19 at 16:31 +0200, Roger Oberholtzer wrote:
but this does not
ftp remfile user:pass@ftp.remote.com:/
The error I get is:
ftp: Unknown port `user:pass@ftp.remote.com', using port 21 ftp: Name or service not known
It is trying to parse 'remfile' as machine...etc part. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFEluaftTMYHG2NR9URAs2LAJ9jtq31+Rtn6CSaOglHxJWE3GgiHgCcCTw/ s4OXfINYsDaDfGRtMXKPbyw= =yYB5 -----END PGP SIGNATURE----- -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Mon, 2006-06-19 at 16:31 +0200, Roger Oberholtzer wrote:
Does SUSE 10 come with a command line ftp copy command. I mean that I can copy a file from the local system to a remote ftp location, giving all info on the command line. Oddly, the ftp client I see in 10.0 allows this when copying from a remote server, but not when copying to a remote server. This works (copies remfile to the local machine): ftp user:pass@ftp.remote.com:/remfile . but this does not ftp remfile user:pass@ftp.remote.com:/ The error I get is: ftp: Unknown port `user:pass@ftp.remote.com', using port 21 ftp: Name or service not known I think is is a bug in that is is parsing the : as though it separates a host and port, when it is separating a user and password. It seems to make no difference how I specify the remote system: including the user:pass part fails.
The GNU/BSD ftp programs don't always take stdin direct chats as well as legacy SysV ones. So I don't recommend their use. There are alternative FTP clients that work much better -- such as curl, ncftp and wget, among others that are built with interactive control (chat/expect-like scripting). A number of my positions (totaling at least 3 years of my career) have included writing shell and Perl scripts for near-real and non-real time, file encryption and/or encrypted file transfer for major financial back-ends at more than one Fortune 100 corporation, as well as a couple of US state municipalities. If you'd like to tell me more about your application/need, I can help you evaluate your best course of action. You can do it off-list if you'd like it to be more confidential. -- Bryan J. Smith Professional, technical annoyance mailto:b.j.smith@ieee.org http://thebs413.blogspot.com ---------------------------------------------------------- The existence of Linux has far more to do with the breakup of AT&T's monopoly than anything Microsoft has ever done. -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
participants (7)
-
Anders Johansson
-
Bryan J. Smith
-
Carl Hartung
-
Carlos E. R.
-
Per Jessen
-
Richard Mancusi
-
Roger Oberholtzer