- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- mput command
Operating System - HP-UX
1822350
Members
4769
Online
109642
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2004 12:54 PM
тАО09-13-2004 12:54 PM
mput command
Hi,
I would like to do ftp of a complete directory. Also I should use "mput" to FTP the directory. But the mput command doesn't allow to "mput" a directory. If it is just a file it is working fine, but doesn't work for a directory. Is there any option I can use to "mput" a directory.
I can't do a tar and untar as on the ftp prompt "tar" doesn't work. Mean to say when I run FTP iam on the destination server where my directory needs to be copied.
I need to do this with a script. I can do this manully, But I want to write a script.
Thank you in advance.
Regards,
Siva
I would like to do ftp of a complete directory. Also I should use "mput" to FTP the directory. But the mput command doesn't allow to "mput" a directory. If it is just a file it is working fine, but doesn't work for a directory. Is there any option I can use to "mput" a directory.
I can't do a tar and untar as on the ftp prompt "tar" doesn't work. Mean to say when I run FTP iam on the destination server where my directory needs to be copied.
I need to do this with a script. I can do this manully, But I want to write a script.
Thank you in advance.
Regards,
Siva
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2004 01:29 PM
тАО09-13-2004 01:29 PM
Re: mput command
Shoulds like you need shell access.
It might work like this:
ftp << EOF
userid
password
lcd
cd
mput *
mkdir
cd
lcd
mput *
EOF
Thing is, it would be much easier with shell access and a tar file. ssh or telnet over and then do tar xvf something.tar
You could also do it by setting up rcp or scp (from secure shell) and doing this from target system:
scp -rp /source targetost:/targetdir
Even if prompted for a password this would do the job with less code and more securely.
SEP
It might work like this:
ftp << EOF
userid
password
lcd
cd
mput *
mkdir
cd
lcd
mput *
EOF
Thing is, it would be much easier with shell access and a tar file. ssh or telnet over and then do tar xvf something.tar
You could also do it by setting up rcp or scp (from secure shell) and doing this from target system:
scp -rp /source targetost:/targetdir
Even if prompted for a password this would do the job with less code and more securely.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2004 02:53 PM
тАО09-13-2004 02:53 PM
Re: mput command
ftp is not a shell. It is a multiplatform file transfer program and the complete list of commands supported by the client is found with the ? command. The server's ftp may not support all of the client's commands. So while mput * looks like it might work with multiple directories and their contents, there are a huge number of compatibility issues. Some mainframes do not have hierarchical directories and others do. There is no option in mput to control descending into lower level subdirectories.
So ftp does not transfer anything except files. Directories must be individually created. Your script will have to determine what directories need to be created, then run ftp to create them, followed by ftp to cd to each directory, use mput * to send all the files and repeat as needed.
Bill Hassell, sysadmin
So ftp does not transfer anything except files. Directories must be individually created. Your script will have to determine what directories need to be created, then run ftp to create them, followed by ftp to cd to each directory, use mput * to send all the files and repeat as needed.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2004 04:01 PM
тАО09-13-2004 04:01 PM
Re: mput command
Ftp is called file transfer protocol to transfer the file's format. mput is used to put multiple files on the destination server. If you want to tranfer the files which is under /tmp/ directory then,
ftp server
ftp> user
ftp> mkdir /tmp/test/
ftp> mput /tmp/*
where * used to select every file.
If you do like this, every file under /tmp/ get selected and prompt's for permission.
We can do shell operation's with ftp easily as,
ftp> !
examample>
ftp> !touch /tmp/testfile;tar -cvf /tst.tar testfile
Else, go to the shell prompt from ftp prompt as,
ftp> !
$
$ exit
ftp>
you can do this on local shell.
If you want to make it in a script then,
------ /tmp/scriptfile ----
user test passwd
lcd /tmp/test/
!tar -cvf test.tar "*.c"
put test.tar
bye
---------------------------
ftp -i -n
Else as,
ftp -i -n <<-EOF
user test passwd
lcd /tmp/test/
!tar -cvf test.tar "*.c"
put test.tar
bye
EOF
HTH.
-Muthu
ftp server
ftp> user
ftp> mkdir /tmp/test/
ftp> mput /tmp/*
where * used to select every file.
If you do like this, every file under /tmp/ get selected and prompt's for permission.
We can do shell operation's with ftp easily as,
ftp> !
examample>
ftp> !touch /tmp/testfile;tar -cvf /tst.tar testfile
Else, go to the shell prompt from ftp prompt as,
ftp> !
$
$ exit
ftp>
you can do this on local shell.
If you want to make it in a script then,
------ /tmp/scriptfile ----
user test passwd
lcd /tmp/test/
!tar -cvf test.tar "*.c"
put test.tar
bye
---------------------------
ftp -i -n
Else as,
ftp -i -n
user test passwd
lcd /tmp/test/
!tar -cvf test.tar "*.c"
put test.tar
bye
EOF
HTH.
-Muthu
Easy to suggest when don't know about the problem!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP