Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP date variable

Status
Not open for further replies.

subashkr

IS-IT--Management
Mar 3, 2003
12
OM
Hi
I use One linux server to download Log files from 90 NT servers at a time using a script. I made a script and its working fine. The log file name is same in all servers. After downloading to the linux box the log file will be renamed to a name which depends on the system date.
But my problem is to rename the log file named Bupdate.log to $date.Bupdate.log in the NT server to avoid downloading the full log again. I could not find any date variable in the ftp client.
script attached

Script 1
=============
cd /home/sigcap/sigcap
exec 4</home/sigcap/sigcap/ipaddress
while read IP <&4
do
TODAY=`date '+%d%m%y'`
ip=${IP}
ftp -vin $ip < /home/sigcap/sigcap/ftp_sigcap.sh 2>&1
mv /home/sigcap/sigcap/BUpdate.log /home/sigcap/BUpdate${TODAY}${IP}.txt
sleep 1
done
exec 4<&-

Script 2
==========

user sigcap sigcap1
cd /main/changes
pwd
ascii
get BUpdate.log
rename BUpdate.log date.Bupdate.log
close
quit


Please revert your openions

Thanks
SKR

 
I had the same problem and resolved it thus :
1)Retrieve your file as above
2)Copy/rename the file with date suffix/prefix
3)Send ftp delete command for file on the NT server
4)Put new 'filename.date' on to the NT server
(this means 3 ftp processes, but will achieve what
you want)


Dickie Bird (:)-)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top