Results 1 to 4 of 4

Thread: Shell script lftp from one ftp server to another then move to /transmitted/ddmmyy

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default Shell script lftp from one ftp server to another then move to /transmitted/ddmmyy

    hi I am quite new to shell script and need to complete the following;

    lftp 10-14 files from one ftp server to another then move the transmitted files to /transmitted/ddmmyy on orginating ftp host.

    FTP Server: Lftp sftp://path
    Path: u2/uat-elan/uat/
    Copy files from above path to: Lftp ftps://path
    Move copied files to new newly created ddmmyyyy folder: u2/uat-elan/uat/transmitted/ddmmyy

    Any assistance would be appreciated.

  2. #2
    Junior Member
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    need to be linux commands using lftp. Thanks

  3. #3
    Senior Member monk's Avatar
    Join Date
    Jan 2005
    Location
    Tibet
    Posts
    643
    Thanks
    5
    Thanked 43 Times in 38 Posts
    Rep Power
    15

    Default

    Did you wrote something? A basic command should be as follows:

    Code:
    lftp -u USER,PASSWORD -e 'set ftp:ssl-force true; put file.name' ftp.example.com
    However, you need to come up with the rest of the logic to create a folders.
    May the force with you!

  4. #4
    Junior Member
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Thanks;

    So ive got it half working, i cant seem to cd to a different directory before running the lftp any help would be appreciated., and the logfile and exit commands seem to not work.

    #!/bin/bash
    LOGFILE=/home/logfile.txt
    DATE='date +%Y%m%d'
    cd /home
    mkdir $DATE
    echo "Get files"
    lftp -u username,password -e 'set ftp:ssl-force true; mget /uat-elan/*.csv' sftp://IP >> LOGFILE
    exit
    ~

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 20th June 2011, 05:04 PM
  2. Script that move files to folders with specific size
    By jasmine89 in forum Linux software
    Replies: 0
    Last Post: 31st December 2010, 01:37 AM
  3. Simple script to move folders
    By noamo48 in forum CentOS / RHEL / Fedora
    Replies: 9
    Last Post: 15th November 2010, 06:29 PM
  4. [Solved] Move Drupal MySQL Database To Another Server
    By jaysunn in forum Databases servers
    Replies: 6
    Last Post: 7th March 2010, 08:17 PM
  5. [HowTo] Bash Shell Script To Ftp File To Server
    By jaysunn in forum Getting started tutorials
    Replies: 8
    Last Post: 1st January 2010, 12:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •