- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: I need a script to transfer a file via ftp fro...
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-29-2003 10:07 AM
09-29-2003 10:07 AM
I need a script to transfer a file via ftp from linux to windows server.
If someone can post it, would be great.
kind regards
chris
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2003 11:20 AM
09-29-2003 11:20 AM
Re: I need a script to transfer a file via ftp from linux to windows server
put an entry like this.
machine macname login username password password.
then
ftp macname <
...
...
EOF
hth
-balaji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2003 06:19 PM
09-29-2003 06:19 PM
Re: I need a script to transfer a file via ftp from linux to windows server
ftp â v â n server << [EOT]
user username passwd
cd C:
cd /dir/dir
put filename
bye
[EOT]
good luck,
Th
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2003 06:23 PM
09-29-2003 06:23 PM
Re: I need a script to transfer a file via ftp from linux to windows server
don't know where those characters come from :(
should be:
ftp -v -n server << [EOT]
-v : verbose
-n : no login (yet)
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2003 06:26 PM
09-29-2003 06:26 PM
Re: I need a script to transfer a file via ftp from linux to windows server
thanks
I have other question.
additionally how to be notify by mail,
when the ftp
transfer was not seccessfully ?
can I do that with the same script ?
regards
chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2003 07:08 PM
09-29-2003 07:08 PM
Solutionthis is not straightforward as ftp always tend to return exit status 0.
You can redirect all output to a logfile and filter out "normal" text and mail the remaining.
something like:
LOG=/tmp/ftp$$.log
ftp -v -n server << [EOT] > $LOG 2>&1
...
grep -v "^220 " $LOG | grep -v "^331 " | grep -v "^230 " | grep -v "^250 " | grep -v "^200" | grep -v "^226" | grep -v "^150 " | grep -v "^120 " | grep -v "^221 " > /tmp/ftperr$$.log
if test -s /tmp/ftperr$$.log
then
mailx user < /tmp/ftperr$$.log
fi
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2003 08:01 PM
09-29-2003 08:01 PM
Re: I need a script to transfer a file via ftp from linux to windows server
$ftpserver="192.168.200.72";
$username="stan";
$password="stan";
$remotedirectory="/home/stan";
$subdirectory="/home/stan";
$remotefilename="/home/stan/first.pl";
$ftp=Net::FTP->new($ftpserver);
$ftp->login($username,$password);
@remotefiles=$ftp->ls($remotedirectory);
$ftuse Net::FTP;
p->cwd($subdirectory);
$ftp->get($remotefilename);
$ftp->quit();
print "\nThe content of /home/stan - directory on $ftpserver:\n\n";
map {$_=$_."\n";print} @remotefiles;
Regards,Stan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2003 07:55 AM
10-10-2003 07:55 AM
Re: I need a script to transfer a file via ftp from linux to windows server
and where can I put my mail address in your
perl script ?
I mean, if the ftp transfer was not successfully running,
I have to be notified by mail.
kind regards
chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 02:12 PM
10-13-2003 02:12 PM
Re: I need a script to transfer a file via ftp from linux to windows server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2003 11:11 AM
10-15-2003 11:11 AM
Re: I need a script to transfer a file via ftp from linux to windows server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2004 03:10 AM
01-12-2004 03:10 AM
Re: I need a script to transfer a file via ftp from linux to windows server
over internet !