- 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
06-14-2007 11:13 PM
06-14-2007 11:13 PM
FTP script.
Files are stored in say /interfaces/sid/send & i want to copy them to target's same directory.
Can anybody help?
Regards,
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2007 11:26 PM
06-14-2007 11:26 PM
Re: FTP script.
#
ftp -in <
user dummyuser dummypass
ascii
cd /interfaces/sid/send
lcd /interfaces/sid/send
mput *
bye
EOF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2007 01:52 AM
06-15-2007 01:52 AM
Re: FTP script.
wget 'ftp://dummyuser:dummypass@ftp.host.com//interfaces/sid/send/*'
The wisdom of storing a password in a script
is, as always, open to question.
http://www.gnu.org/software/wget/wget.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2007 01:57 AM
06-15-2007 01:57 AM
Re: FTP script.
you're trying to pull the files in, not push
them out. (There is a "wput" program out
there somewhere to go the other way, but I
don't know much about it.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2007 02:36 AM
06-15-2007 02:36 AM
Re: FTP script.
Fortunately, it's trivially easy to do full-blown error checking with Perl's Net::FTP module. The attached Perl script will do everything you need and you don't even have to know any Perl. All you have to do is check the status of the command itself and if it is zero then all was well.
For your specific problem:
typeset -i STAT=0
cd /interfaces/sid/send
ftpput.pl -h target -l dummyuser -p dummypass -d /interfaces/sid/send -B -t 3 myfile1 myfile2 myfile3
STAT=${?}
if [[ ${STAT} -ne 0 ]]
then
echo "FTP Xfer failed; status ${STAT}" >&2
fi
exit ${STAT}
----------------------------------------
This would ftp to host target, login as dummyuser, cd to /interface/sid/send, set binary mode, allow for up to 3 retries (-t 3), and then put myfile, myfile2, and myfile3. You don't even have to pass the password on the command line because you can use a .netrc file -- just like real FTP.
Invoke as ftpput.pl -u for full usage. There is also a secure FTP version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2007 05:38 PM
06-15-2007 05:38 PM
Re: FTP script.
# cat /var/tmp/ftpsct
/usr/bin/ftp -v -n > /var/tmp/ftpsct.log 2> /var/tmp/ftpsct.err <
user name password
prompt
cd /ddir
bin
mput file*
ls /tmp
quit
EOF
Replace the username/pw,destination system, dir, etc.
sh /tmp/ftpsct (run the script)
after that you can verify /var/tmp/ftpsct.err & ftpsct.log files.
Regards,
Rasheed Tamton.