FTP the file from other server to local server

FTP the file from other server to local server

#!/bin/bash
HOST='ftp.askhareesh.com' #HostName
USER='AskHareesh' #UserName
PASSWD='@5kh@r335h' #Password
DIREC='/out/tmp/' #Directory of the file to save
FILE='AHSalesOrders' #File Name starts with
echo "Host : $HOST"
echo "User Name : $USER"
echo "Directory : $DIREC"
echo "File Name starts with : $FILE"
echo "Start of the Script"
cd $DIREC
#Start of FTP script
ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
cd OUT
mget $FILE*.csv
bye
EOT
#Loop for renaming/archiving the files
for FNAME in $FILE*.csv
do
echo "File Name : $FNAME"
ftp -n -v $HOST << EndLOOP
ascii
user $USER $PASSWD
prompt
cd OUT
rename $FNAME $FNAME.done.$(date "+%m%d%Y%H%M")
bye
EndLOOP
done
echo "End of the Script"
*/

2 comments:

  1. 25% OFF on Oracle Apps R12 Financials Self Paced Course along with 11 Additional Add On Courses (321 Session Videos of 120 Hours Recordings). Our Top Trending Course with 1700 Enrolled Udemy Students

    Please Check https://www.oracleappstechnical.com for details

    ReplyDelete