Tuesday, September 25, 2012

Auto FTP transfer in shell script

Credit to Sim Wei Chieh

How to create shell script to auto ftp transfer

Objective:
- Create a new folder each time perform ftp transfer to target server with a set of files through wildcard.

Here is the code for autoftp.sh:

Time=$(date +"%F_%HH%MM%SS")
ftp -n <        open
        user
        binary
        prompt
        cd /home//
        mkdir timeoutput_top_error_log_$Time
        cd timeoutput_top_error_log_$Time
        lcd /root
        mput setoffilenames*
        bye
EOF



No comments: