Dowload file using ftp in bash script

Hi! I'm runnig a bash script in solaris i want within the script to dowload file using ftp
How can i do it?
Tanks a lot

hello,evgchech
please try this way:
1. In the bash script, try following command:
ftp -n < ftpcmdfile2 in the ftpcmdfile (which is a file),coding the interactive commands of FTP such as:
user anonymous  [email protected]
          cd /var/sun/download
          bi
          mget *.*
          bye
     try it and good luck!
Wang Yu
Developer Technical Support
Sun Microsystems
http://sun.com/developers/support

Similar Messages

  • How to download file using ftp in bash script

    Hi! I'm runnig a bash script in solaris i want within the script to dowload file using ftp
    How can i do it?
    Tanks a lot

    hello,evgchech
    please try this way:
    1. In the bash script, try following command:
    ftp -n < ftpcmdfile2 in the ftpcmdfile (which is a file),coding the interactive commands of FTP such as:
    user anonymous  [email protected]
              cd /var/sun/download
              bi
              mget *.*
              bye
         try it and good luck!
    Wang Yu
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • How to Create a Flat File using FTP/File Adapter

    Can any body done workaround on creating the Flat file using FTP/File Adapter?.
    I need to create a simple FlatFile either using of delimiter/Fixed length. using the above said adapters we can create XML file, i tried concatinating all the values into a single String and writing into a file, but it does not have proper structure
    Can any body help me out on this..
    Thanks
    Ram

    You can create a text schema while creating a File Adapter. If schema is specified for File Adapter, it takes care of converting XML into fixed length or delimited format.
    Thanks,
    -Ng.

  • HOW to read file using ftp???

    Hi to all,
    I have problem with reading file using ftp connection, i want to read only 1024 bytes for one time, and i have
    next code wich read this:
    byte buffer[] = new byte[1024];
    while( (readCount = input.read(buffer)) > 0) {
    bos.write(buffer, 0, readCount);
    but I dont know how to put all read data in one byte[] if i dont know length of file.
    I can't do some like: byte file[] = new file[1000000];
    Thanks for all sugestions!

          * Download a file from a FTP server. A FTP URL is generated with the following syntax:
         * <code>ftp://user:password@host:port/filePath;type=i</code>.
          * @param ftpServer FTP server address (incl. optional port ':portNumber').
          * @param user Optional user name to login.
          * @param pwd Optional password for <i>user</i>.
          * @param fileName Name of file to download (with optional preceeding relative path, e.g. one/two/three.txt).
          * @param destination Destination file to save.
         * @throws MalformedURLException, IOException on error.
         public void download(String ftpServer, String user, String pwd, String fileName, File destination) throws MalformedURLException, IOException {
            if (ftpServer != null && fileName != null && destination != null) {
                StringBuffer sb = new StringBuffer("ftp://");
                if (user != null && pwd != null) { //need authentication?
                    sb.append(user);
                    sb.append(':');
                    sb.append(pwd);
                    sb.append('@');
                }//else: anonymous access
                sb.append(ftpServer);
                sb.append('/');
                sb.append(fileName);
                sb.append(";type=i"); //a=ASCII mode, i=image (binary) mode, d= file directory listing
                BufferedInputStream bis = null;
                BufferedOutputStream bos = null;
                try {
                    URL url = new URL(sb.toString());
                    URLConnection urlc = url.openConnection();
                    bis = new BufferedInputStream(urlc.getInputStream());
                    bos = new BufferedOutputStream(new FileOutputStream(destination.getName()));
                    int i;
                    while ((i = bis.read()) != -1) { //read next byte until end of stream
                        bos.write(i);
                    }//next byte
                } finally {
                    if (bis != null) try { bis.close(); } catch (IOException ioe) { /* ignore*/ }
                    if (bos != null) try { bos.close(); } catch (IOException ioe) { /* ignore*/ }
            }//else: input unavailable
        }//download()If you don't want to strore the data into a file, use ByteArrayOutputStream instead of a FileOutputStream.

  • Not able to send file Using FTP in SSIS 2005

    I am using SSIS 2005
    I am trying to send file to ftp server using FTP task in SSIS but i am getting following error.
    Error Message-:An error occurred in the requested FTP operation.
    Detailed Description-:550 /FileName.txt: Access is denied.
    RemotefilePath is /
    I need a advice.
    Thanks in advance.

    I got this error recently from the FTP task in SSIS:
         Unable to send files using "FTP".
    I had everything correct, by the book.  I was trying to send a file, but I got the same error when trying to receive a file. 
    I already verified that I could send the file via command line FTP, so the FTP was not "secure FTP" (which wouldda required FileZilla or WinSCP or something similar) and my credentials were fine. 
    But I still got the above error.  Heck, I was beginning to thing that the FTP task in SQL Server 2008 was broken and just couldn't send files.
    Well, this issue is now resolved.  The problem was in the
    destination folder.  I was assuming that the root folder for my FTP account held the files. 
    So I entered the destination folder as this:   
    /data_in/
    But... the FTP task sees the root folder as one up from that. 
    So I had to use my account name in the path... meaning I had to change the destination folder to this:    
        /myaccountname/data_in/
        (where "myaccountname" was my login to the FTP site.)
    I hope this post helps someone else.
    Donna

  • To download a file using Ftp.

    I am making a web application using struts framework . now on one jsp page i'll have to give the list of files on the ftp server and link to download those files using ftp from the ftp server.
    I have made functions using jakarta commons.net library by which i m able to show the list of files on jsp page but i m not able to give download link bcos using the function the file is downloaded on the server on which my application is running . and not from which i am accessing through the browser.........
    If any one have any idea pls let me know...........?
    Regards,
    Neeraj.

    If it's anonymouse FTP to download from the server, just make the page have a link to the FTP site..
    some file

  • How to upload a file using FTP tin JSP

    Hello friends ,
    I m actually looking to upload a file using FTP to a server(webserver) in JSP . If there any tags available to accomplish this r any information regading this plzz let me no.
    Thanks in advance
    P.Satish

    Not sure exactly what you're trying to do but you set the content type a stream it to the browser from a servlet

  • File format while sending a file  using FTP Process

    Hi,
    I am facing a formatting problem when i send a file from SAP application server to a different sever using FTP process.
    The problem is like this:
    Lets say I have a file with 10 records on the application server. When i am downloading this file to a pc, the file is showing 10 lines.
    But when i open the same file on the other server it is showing 10 records as 1 line.
    The file i am sending is a text file.(ex: acc_payable.txt)
    If i open the same file on the other server using word pad it is showing 10 records in 10 different lines.
    I want the file to be opened using notepad and want to see the each record in a different line
    Can anybody help me on this issue
    Regards,
    Radhakrishna

    Another stab at "simplest": can you avoid embedding
    newline characters in the strings
    your write and reply on PrintWriter's
    println() methods instead?But, if I understand the OP, this will cause the same problem. He is running on Unix but wants to generate a DOS type eol. The println() method will use the OS default; therefore, he needs to explicitly specify the DOS eol.

  • Transfer files using FTP from one r/3 server to another on windows platform

    Hi ,
    I am trying to transfer a text file from one r/3 server to another
    this should be done using ftp.
    I am working on widows OS & i have tried all the RSFTP* pgm's none satisfy my req. please tell proper method to do so or if any pgm please tell properly.
    Regards,
    Prateek Kumar

    If you haven't figured the migration out already, you may want to check out this thread:
    http://discussions.info.apple.com/thread.jspa?threadID=2205892
    It looks like the path to take from everything I'm seeing, but if you've found a friendlier solution I'd be happy to give it a shot!

  • Getting remote file using FTP Server Issue in OSB

    Hi Guys,
    I have configured a FTP server on my local system and I created a proxy service to get file from ftp location to some other location but it fails . I used ftp protocol for getting file
    and my ftp location is D:\host\ftp and it has another folder called osb . I used ftp as protocol and EndPointURI is ftp://localhost/. It fails to get files and shows error message like
    com.bea.wli.sb.transports.TransportException: <user:osb>Unable to list files for
    directory: .
    at com.bea.wli.sb.transports.ftp.connector.FTPWorkPartitioningAgent.exec
    ute(FTPWorkPartitioningAgent.java:218)
    In case of Business Service, writing a file to ftp location (i.e ftp://localhost/ means D:\host\ftp\osb) working.
    I used service account for both proxy,BS to connect . osb is username and same as password.
    Can Any one please suggest me How to solve this issue?
    Thanks,
    Srinivas.
    Edited by: 863597 on May 22, 2012 1:06 AM

    Hi Vijay Thank you,
    Can we do the pooling directly using FTP protocol like JMS protocol in OSB with out using FTP JCA Adapter.I did in such a way but it fails. For pooling files the mentioned endpoint uri is as ftp://localhost/ and it actual path is D:\host\ftp and ftp has another folder called osb here i have to get the files from this osb Can any one suggest me if there is any problem with the ftp protocol end point.
    Thank You,
    Srinivas.

  • File format conversion of Target file using FTP adapter

    Hi All,
    I am using FTP adapter to create the file on the Target side. But file needs to below format : How do i conver the XML File fomat( Default generate by XI ) to be generat to below file format;
    000000000000154162,
    CWC1A,,,,
    CWC1B,,,,
    CWC2A,,,,
    CWC2B,,,,
    Please provide your suggestion;
    thanks;
    MK

    Hi Mohan,
       I have a collection of Blogs (links) which Specify the File content conversion parameters.
    File content conversion, I am Not sure as which Link will Match Your Requirement exactly...
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    Please see the below links for file content conversion..
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter - FCC
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter - FCC
    File Content Conversion for Unequal Number of Columns
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns - FCC
    Content Conversion (Pattern/Random content in input file)
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file - FCC
    Regards,
    Sainath chutke

  • Sending file using FTP

    Hi Friends,
    I have developed a abap program that download a excel file to a application server.
    i need to send the file to a shared folder or share point using FTP.
    How can i send the file which is in Application server thru FTP?
    Can anybody guide me on this?
    Thanks in Advance
    Suganya

    Hi,
    U need to use the stsndard FTP function modules to achieve it..
    The following FM are useful --
    FTP_CONNECT
    FTP_COPY
    Thanks,
    Arun

  • How to Downlaod a Excel file using FTP- -JSP

    Hi..i am dynamically generating excel file(i.e...writing into the excel file from Acees databse after executing the queries on it)...i have set the content-type to vnd-msexcel ....now i want that file to be downlaoded using FTP...FTP is new to me...any help could be greatly appreciated...
    Thanks in advance....

    JavaWorld published an article about this topic. It is called "Java FTP client libraries reviewed" and it can be found here :
    http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html
    Best regards
    Jean-Pierre Norguet
    Jean-Pierre Norguet
    JavaWorld Press
    http://wasa.ulb.ac.be/jp.html

  • Problem archiving file using FTP adapter

    Hi,
    I am polling some files from another server using FTP adapter in SOA 11g. Even though I have checked the option to archive the files, the files get archived successfully on the server where the SOA process is running, but I am unable to archive the files on the server from which I am reading the file
    I am not sure whether this is the default behaviour or is there any way to archive files on the same server from which I pick or read the file.
    Any help is appreciated.
    Thanks,
    Namrata

    Hi Neeraj,
    Thanks, the archiving in the remoteLocation worked by doing what you told me...
    I tried archiving to the local machine which is not working for me ... i gave both the properties as below...
    <property name="UseRemoteArchive" value="false"/>
    <property name="PhysicalArchiveDirectory" value="C:\Users\naresh\Desktop\ftp"/>
    Thanks,
    Naresh

  • How to upload and download files using FTP to a server(webserver) in JSP

    I have to upload and download multiple files Of(size >5 MB)using FTP to a
    Server(webserver) in JSP
    how to do that ?

    Or he could create his own tag libraries, no? :)One supposes that, technically, one could create a taglib wrapper around an existing FTP library. There might be licensing issues with distributing that taglib wrapper.
    Of course, one could find the FTP RFC online, read it, and implement one's own FTP client implementation, complete with a tag library access point.

Maybe you are looking for

  • How Can I Network My New Printer?

    My trusty Epson 880 printer finally gave up the ghost and I replaced it with a very basic Epson Stylus T20E sold here in Thailand. One of the immediate disappointments is that I could not print wirelessly, as I had with the Epson 880, using my Airpor

  • Why is my MacBook Pro (mid-2012) so unresponsive and slow?

    I have been having many huge problems with my MacBook Pro recently. First of all, it takes a minute to two minutes to boot up. Whenever I try to open an application, it usually takes 30 seconds or so to even open, and it remains unresponsive (with th

  • Where can i get an apps to install photoshop 5.5 on windows 8

    anyone know where to get this apps thanks

  • IE - signed cab vs. signed jar problems

    In IE on Windows when I sign an applet that is part of a package in a cab file it works like this; The first time the user hits the applet tag, IE downloads the cab and asks if you trust the applet. When the user clicks yes, it is installed to the do

  • Page frame

    Hi Friends, I am new to indesign scripting (vb.net). I want to add a page with frame content "hello world" from page 2 to 5. This is the code i have used For i = 2 To 5 mydoc.Pages.Add() mypage = mydoc.Pages.Item(i) myframe = mypage.TextFrames.Add my