#!C:\Perl\bin\perl.exe ########################################## # Begin stuff the user needs to configure ########################################## # Intranet destination for FTP site. $destination = 'C:/foo/bar/'; # Base name suffix for output files. This combines with the base # name prefix sent as 1st arg from MPT. $output_file_suffix = ".txt"; ########################################## # End stuff the user needs to configure ########################################## my ( $arg_1_fm_mpt, $arg_2_fm_mpt ) = @ARGV; sub write_arg_to_file { if ( open STATUS, ">> $destination" . $arg_1_fm_mpt . $output_file_suffix ) { print STATUS "\nOn " . scalar localtime(time) . " MPT reported: " . $arg_2_fm_mpt; close STATUS; print "\nWrite to FTP completed."; } else { warn "\nOops! Could not open file for writing." } } write_arg_to_file(); __END__ =head1 NAME FTP Upload Utility for a Single MPT Specimen =head1 SYNOPSIS gus_mpt_ftp_put.pl 'string 1' 'string 2' =head1 DESCRIPTION Track the progress of MTS MultiPurpose TestWare tests (or perhaps some other) from outside the testing facility via FTP. This is the best way to track an individual MPT specimen because it can be called within the MPT procedure itself.Suppose you have a I testing machine running a test on a servo-hydraulic test fixture affectionately named I. That test runs 24/7 for weeks on end. But you cannot afford the downtime if it should stall at night and on weekends while unobserved. Also you do not want to waste employee-hours to tend the machine all this while. Answer: assign an employee to monitor I remotely by FTP. This script provides for that. =head1 EXAMPLE Suppose that your company has an FPT server and that on the company side of the firewall the deamon's outgoing directory is in the path B>. To accomodate that you edit this Perl script's configuration thus: B>. And again suppose you have a test arbitrarily named I running under I on I software by I. Inside of the that you can employ a special process called I. The application to start is this script. And when calling is script by I, you give it two arguments. Both arguments are strings. The first arg would be C< 'slithy_tove' > and the second might be C< 'Mimsy were the borogroves' > or anything else at all. The result of this would be a line written (or appended) to the path C< K:/foo/slithy_tove.txt > such that its most recent line would be C< On Mon Feb 2 13:34:17 2004 MPT reported: Mimsy were the borogoves > with the date from when I was triggered. Personally, I like to put one at the head of every I process. Then from home an hour away I can FTP-download a reasonably up-to-date status file for any test where I've employed this script. =head1 PREREQUISITES For use in congunction with the I process of I software on I testing machines by I...or any other similar software which can fork an event to Perl. =head1 SEE ALSO Perl script gus_mpt_ftp_get.pl for use in concert. =head1 AUTHOR Gan Uesli Starling > =head1 COPYRIGHT Copyright (c) 2004, Gan Uesli Starling. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SCRIPT CATEGORIES Misc =cut