- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- FTP SCRIPT
Categories
Company
Local Language
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
Discussions
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
Community
Resources
Forums
Blogs
- 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
04-04-2006 06:40 PM
04-04-2006 06:40 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 06:52 PM
04-04-2006 06:52 PM
Re: FTP SCRIPT
echo "echo "user user_name user_pass"
echo "bin"
echo "cd /to_dir"
echo "put your_file"
echo "close"
echo "bye"
)|ftp -vni hostname > log_file
AND
ftp -in myhost << EOF
user username password
get /tmp/bla
get /tmp/foo
EOF
Not good as it exposes the password. Use scp instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 07:20 PM
04-04-2006 07:20 PM
Solutionftpbatch your-ftp-host file1 file2
-----------------------------
#!/bin/sh
#?-----------------------------------------------------------
#? ftpbatch utility
#?
#? Syntax:
#? ftpbatch
if [ $# -lt 2 ]
then
grep '#?' $0 | grep -v grep | tr -d "#?"
exit 1
fi
THEHOST=$1
username=userx
userpw=ftppwd
localpath=/tmp
shift
NBPARAM=$#
FICTMP="/tmp/MFTPTMP.tmp.$$"
umask 077
#
echo "user root omccn1" >$FICTMP
echo "binary" >>$FICTMP
echo "lcd $localpath" >>$FICTMP
I=`expr 0`
while [ $I -lt $NBPARAM ];do
destfile=`basename $1`
echo "get $1 $destfile " >>$FICTMP
echo "site chmod 777 $destfile" >>$FICTMP
I=`expr $I + 1`
shift 1
done
echo "quit" >>$FICTMP
#
ftp -inv $THEHOST < $FICTMP
rm $FICTMP
exit 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 08:29 PM
04-04-2006 08:29 PM
Re: FTP SCRIPT
Solution:
ftp -in
user
commands
bye
!
will work.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 08:30 PM
04-04-2006 08:30 PM
Re: FTP SCRIPT
Read netrc man page for example setup. Then use ftp script without user command.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 08:36 PM
04-04-2006 08:36 PM
Re: FTP SCRIPT
I am not sure whether by 'folder' you mean a file or directory.
For individual file transfer see earlier answers.
For copying directory structure, seem the various packages at:
http://hpux.connect.org.uk/hppd/hpux/Networking/FTP/
Other solutions would be to use rcp or nfs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 08:38 PM
04-04-2006 08:38 PM
Re: FTP SCRIPT
You can take a look these threads for more information,
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=973452
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=129038
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 10:27 PM
04-04-2006 10:27 PM
Re: FTP SCRIPT
:-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 10:28 PM
04-04-2006 10:28 PM
Re: FTP SCRIPT
-Arun