- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: scripts for ftp uploading and downloading
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
09-13-2001 02:10 AM
09-13-2001 02:10 AM
scripts for ftp uploading and downloading
Please help us how to create scripts for ftp downloading and uploading so I can automate this during off peak hours.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2001 02:28 AM
09-13-2001 02:28 AM
Re: scripts for ftp uploading and downloading
this is fairly simple:
Have commands.ftp like
cd /remote_sourcedir
lcd /local_targetdir
asc
get file_to_download
bye
Set up .netrc for the OS-user to use this interface.
execute
cat commands.ftp | ftp targethost
That is all
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2001 02:29 AM
09-13-2001 02:29 AM
Re: scripts for ftp uploading and downloading
ftp -i -n -v << EOF
open your_sytem
user your_user_name your_passwd
cd your_dir
prompt off
mput * (or put your_file)
bye
EOF
You can also use netrc if you don't want to include your user name and password in this script. But you have to - somewhere.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2001 04:15 AM
09-13-2001 04:15 AM
Re: scripts for ftp uploading and downloading
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2001 04:32 AM
09-13-2001 04:32 AM
Re: scripts for ftp uploading and downloading
Nowadays where there is strong encryption and ssh available one should deprecate the use of the r* commands, telnet, and ftp.
Best remove their service from inetd.conf.
Only if you are using them in a firewalled, trusted host environment are they acceptable.
If you still insist on ftp read the manpages of ftp, and netrc.
It's all described therein.
If you like Perl it's much less a pain in the a* to use the CPAN modules Net::Ftp, Net::Telnet, Net::Expect, or better Net::SSH::Perl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2001 07:40 AM
09-13-2001 07:40 AM
Re: scripts for ftp uploading and downloading
why did you not "search" for this topic first?
There are already a lot of very good answers for it!
Well, the main point is, there are features built into ftp
for doing just that, so you do NOT need all that fuss
about input-redirection ;-)
On UN*X systems, you have to use the file
"$HOME/.netrc"
and on Windows systems (client-wise speaking) there
is an command-line option for it.
UN*X:
Your "$HOME/.netrc" would have permissions 600 and
look like this (replace UPPERCASE with your own values):
machine SERVER login USER password SECRET macdef init
cd /remote-dir
lcd /local-dir
prompt
binary
mput *.*
quit
There should be an empty line at the end of that
paragraph.
On Windows you have the option "-s:" to pass a textfile
containing the username, password , and commands,
where the the first line contains the username, the
second contains the passwords, and the rest of the file
contains the commands, just like on UN*X.
HTH,
Wodisch