Hi,
I was planning to write a FTP script that will FTP files to destination folder. All configuration should be done through a properties files, I have developed two files under /home/499633/scripts) scripts folder, and my main file(ftp_script.sh) should read the properties from the properties file(ftp.properties) .I have already made a properties file naed (ftp.properties) that contain the details like
(ftp.properties)
*****************
# these are the sample valus taken
135.23.34.212 userid password sourcefolder destfolder
The contents of the ftp_script.sh) are
****************************************
#!/bin/sh
while read line
do
RemoteIP=`echo $line | cut -d' ' -f1`
userid=`echo $line | cut -d' ' -f2`
passd=`echo $line | cut -d' ' -f3`
spath=`echo $line | cut -d' ' -f4`
dpath=`echo $line | cut -d' ' -f5`
ftp -vin >> ftp.log <<-!
open $RemoteIP
user $userid $passd
cd $dpath
lcd $spath
put $file
bye
!
done</your/ftp/properties/filepath/ftp.properties
Now my query is that in file ftp_script.sh at the end of the while loop the path of the ftp.properties file would be /home/499633/scripts/ftp.properties would be ok ...?
Second if I execute this script what remote ip denotes here the ip of sender(mine one) or the ip of the reciever..?