If I understand correctly, you are looking for something similar to a release distribution process. You are sending files via FTP to each client machine from your server, and you want to know how to kick off the unzip remotely on the client machines from the server (or within FTP).
Well, to start with, you can't kick off
unzip remotely within an FTP session, for obvious security reasons.
There are a lot of commercial (and free?) products to do remote package/zip releases (such as OnCommand). You will have to do a bit of research on this.
Or you can write your own Windows service on each of the client to unzip any FTP files in certain predefined directories after they arrive. But that could be a complicated task if you want to do it properly. You need to introduce trigger files with CRC to make sure the FTP is complete, and to be efficient, you probably need to use the system filewatcher instead of a periodic poller.
If I was to implement the solution, I won't bother with remote processes because they are complicated and not worth the effort. If your data files are not big, you could just write a simple FTP program that runs on your server, and sends all the data files to each of the clients in a list. The following is an outline of the algorithm:
my @clients;
my @files_to_send;
foreach my $client(@clients) {
my $c = create_FTP_connection($client);
foreach my $file(@files_to_send) {
$c->Put($file);
}
close_FTP_connection($c);
}
Update: If you already has the FTP scripts on the clients, then you simply need to do a
system($PATH_TO_WINZIP, "filename.zip"); or something alike to extract the zip file. You need to check the Winzip manual to find out the correct parameters to use.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.