- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- automatic ftp
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
08-01-2001 06:53 AM
08-01-2001 06:53 AM
I have defined an automatic open ( .netrc)
So my shell is esay like that :
#!/bin:ksh
ftp toto
cd dir
put fic
bye
EOF
when I execute this I anm under
ftp >
So I want to execute automatics commands !
Thanks if you know . . .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 07:02 AM
08-01-2001 07:02 AM
Re: automatic ftp
ftp -n ftp.somesite.com <
ls
quit
EOD
-- Rod H
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 09:35 AM
08-01-2001 09:35 AM
Re: automatic ftp
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 10:25 AM
08-01-2001 10:25 AM
Solutionalso, I tend not to use the macros in the netrc because that give you two files to maintain if you need to make changes. here is what I do.
Make your entry into .netrc
in your script use
ftp 11.11.11.11 << EOF
get ***
put ***
bye
EOF
You can also use variables as well
ftp 11.11.11.11 << EOF
get $newfile
put $oldfile
bye
EOF
Rusty Sapper
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 12:02 PM
08-01-2001 12:02 PM
Re: automatic ftp
I would use perl (5.x) with the ftp module. this gives you also the possibility to hide the password in a root-only readable file. The nice thing about the perl solution is, that all the error checking is in the module.
Anyway, just a thought
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 12:29 PM
08-01-2001 12:29 PM
Re: automatic ftp
I have to agree with Micheal.
When I have to do ftp scripting these days, I use perl with the Net::FTP module (available for download at www.perl.org/CPAN). It really makes FTP operations very simple. Any error conditions and timeouts are easy to test for and set. It you don't know perl, now would be a good time to learn.
It's usually something as simple as this (with error checking omitted):
use Net::FTP;
$ftp = Net::FTP->new("remotehost.name", Debug => 0);
$ftp->login("anonymous",'cstephen@xxx.com');
$ftp->cwd("/downloads");
$ftp->get("testfile.txt");
$ftp->quit;
Another nice feature is that this same script works in the Windows world as well.
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 09:44 PM
08-01-2001 09:44 PM
Re: automatic ftp
echo "open the.ip.of.machine \user username password \[bin|ascii] \[get|put] file \quit" | ftp -n -i -v >> ./ftp.logfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2001 05:22 AM
08-02-2001 05:22 AM
Re: automatic ftp
#!/bin/ksh
... setup your variables here ...
# If all the files to be ftp'd are in multiple
# locations, get an 'ls' listing of these and
# record them in a file, $FILELIST.
# Move the $FILELIST files into one temp area.
for i in `cat $FILELIST`
do
mv $i $FTPDIR
done
# ... and then ftp them ...
cd FTPDIR
{ echo "open TARGET-NODE
mput *
close"
} | ftp -v 2>&1 | tee FTPLOG
... using tee to log the process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2001 06:58 AM
08-02-2001 06:58 AM
Re: automatic ftp
You need to redirect you standard iput like the following :
#ftp
get
END
Magdi