From: Atropo on
Hi all, I'm on solaris 5.10 and trying to get several files from
windows server, but with the condition that the files do not have the
extension ".par" (partial or being processed). help mget is not very
helpful.
From: Radoulov, Dimitre on
On 14/06/2010 15.47, Atropo wrote:
> Hi all, I'm on solaris 5.10 and trying to get several files from
> windows server, but with the condition that the files do not have the
> extension ".par" (partial or being processed). help mget is not very
> helpful.


You can use Perl:


perl -MNet::FTP -e'
( $host, $user, $pass ) = @ARGV;
$ftp = Net::FTP->new($host) or die "$@\n";
$ftp->login( $user, $pass ) or die $ftp->message;
$ftp->binary;
@files = grep !/\.par/, $ftp->ls;
$ftp->get($_) for @files;
$ftp->quit or die $ftp->message;
' <host> <user> <pass>



Regards
Dimitre
From: Radoulov, Dimitre on
On 14/06/2010 22.47, Radoulov, Dimitre wrote:
> On 14/06/2010 15.47, Atropo wrote:
>> Hi all, I'm on solaris 5.10 and trying to get several files from
>> windows server, but with the condition that the files do not have the
>> extension ".par"

[...]

> perl -MNet::FTP -e'
> ( $host, $user, $pass ) = @ARGV;
> $ftp = Net::FTP->new($host) or die "$@\n";
> $ftp->login( $user, $pass ) or die $ftp->message;
> $ftp->binary;
> @files = grep !/\.par/, $ftp->ls;


It should be:


!/\.par$/
^


> $ftp->get($_) for @files;
> $ftp->quit or die $ftp->message;
> ' <host> <user> <pass>



Dimitre

From: Ben Finney on
Atropo <lxvasquez(a)gmail.com> writes:

> Hi all, I'm on solaris 5.10 and trying to get several files from
> windows server, but with the condition that the files do not have the
> extension ".par" (partial or being processed). help mget is not very
> helpful.

If installing programs onto the server is an option, you should consider
Rsync <URL:http://rsync.samba.org/download.html> instead of FTP. You'll
get much better control over which entries are transferred, and more
efficient transfers into the bargain.

--
\ “Facts do not cease to exist because they are ignored.” —Aldous |
`\ Huxley |
_o__) |
Ben Finney