The sequence of ftp commands inside the script is simple:
- Connect to ftp.emc.com
- Log in using the user name anonymous and a password unique to the NS 120
- change directory to /incoming/APMxxxxxxxxxxx (where the string of x's is replaced with the NS 120 serial number)
- transfer the Zip file
The script would always fail at step #3 with the message: File unavailable.
The root of the problem is that the transfer_support_materials script expects the directory to exist, but it doesn't.
At first I thought that the problem was with the EMC anonymous ftp server. I opened several SRs trying to get someone to create the directory. None of the SRs ever reached a satisfactory closure, and I was left with the impression, Of course the directory doesn't exist; we delete them after a couple of days automatically.
So..... The tool to transfer diagnostics expects the directory to exist, and the business process at EMC deletes the directory as a routine matter.
At the suggestion of one of my colleagues, I ran ftp by hand, and discovered that it would happily let me create the directory. That is, I could manually do this:
- Connect to ftp.emc.com
- Log in using the same credentials as the NS 120
- mkdir /incoming/APMxxxxxxxxxx
- cd /incoming/APMxxxxxxxxxx
- transfer the Zip file
I decided to tweak transfer_support_materials, adding this new element to the existing sequence of ftp commands. The change is really simple. This:
#do transfer
LFTPCOMMANDFILE="open -u ${username},${password} $HostName;cd $remote_name;rm -f ${newfile##*/};put $newfile"
becomes this:
#do transfer
LFTPCOMMANDFILE="open -u ${username},${password} $HostName;mkdir $remote_name;cd $remote_name;rm -f ${newfile##*/};put $newfile"
Ran a quick test of the script after this change, and Voila!, it works again.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.