Shell script - LFTP

Discussion in 'Programming/Scripts' started by tsvikash, Sep 4, 2008.

  1. tsvikash

    tsvikash New Member

    Hi All,:confused:

    I using crontab that run script on each morning to collect lots of text file from a server and send them to FTP server as one tar file(about 600MB).
    I would like to copy this one tar file from the FTP server to a local machine, but first I need to check each hour that the tar file is found on the FTP server.
    Meaning is that I need to connect to the FTP server hourly and check if the tar file exist.
    I'm using lftp and using the command lftp -f FileNameWhichContainTheBelow

    Code:
     
    open myftp.ftp.com
    user username password
    cd /some_directory/
    mv textfile.tar Finishedtextfile.tar
    get [B]Finishedtextfile.tar[/B]
    
    The script should check if Finishedtextfile.tar exist, if yes, get it.
    Regards,:)

    Tsvika
     

Share This Page