Below is a small script snippet to collect data from FTP server using wget.
# Getting data from FTP server now.
wget --ftp-user='username' --ftp-password='passwd' --no-passive-ftp ftp://ftpserver//FileName.zip -P $FTP_DOWNLOAD_BASE_PATH/ - q
# Sample Code below to do some ftp collection
currentdate=$1
loopenddate=$2
if [ "$currentdate" -lt "$loopenddate" ]
then
until [ "$currentdate" -eq "$loopenddate" ]
do
echo "$currentdate:Started wget"
wget --ftp-user=username --ftp-password='passwd' -m --no-passive-ftp ftp://ftpserver//$currentdate/ -P /ftp/$currentdate - q
echo "$d:Finished wget"
currentdate=$(/bin/date --date "$currentdate 1 day" +%Y%m%d)
done
fi
Complete FTP using wget will be on git. Will update soon.
Comments
Post a Comment